cmd/gpt: avoid NULL check before free()

free() checks if its argument is NULL. Do not duplicate this in the calling
code.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
Heinrich Schuchardt
2020-05-01 11:34:01 -04:00
committed by Tom Rini
parent ea5d3731b8
commit b142d0ac19
+2 -4
View File
@@ -772,11 +772,9 @@ static int do_rename_gpt_parts(struct blk_desc *dev_desc, char *subcomm,
out:
del_gpt_info();
#ifdef CONFIG_RANDOM_UUID
if (str_disk_guid)
free(str_disk_guid);
free(str_disk_guid);
#endif
if (new_partitions)
free(new_partitions);
free(new_partitions);
free(partitions_list);
return ret;
}