env: superfluous check before free()

Free() checks if its argument in NULL. There is no need for the caller to
do the same.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
This commit is contained in:
Heinrich Schuchardt
2021-10-26 00:41:59 +02:00
committed by Tom Rini
parent 73d18e352d
commit 28ab12ad14

2
env/flash.c vendored
View File

@@ -210,7 +210,6 @@ static int env_flash_save(void)
perror:
flash_perror(rc);
done:
if (saved_data)
free(saved_data);
/* try to re-protect */
flash_sect_protect(1, (ulong)flash_addr, end_addr);
@@ -298,7 +297,6 @@ static int env_flash_save(void)
perror:
flash_perror(rc);
done:
if (saved_data)
free(saved_data);
/* try to re-protect */
flash_sect_protect(1, (long)flash_addr, end_addr);