summaryrefslogtreecommitdiff
path: root/cmd/gpt.c
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2020-04-28 21:40:13 +0200
committerTom Rini <trini@konsulko.com>2020-05-01 11:34:01 -0400
commitb142d0ac1946701f4d592869c2d81e42afe2e294 (patch)
treea14d992d100d75da51a7b7b3bcff2b58f485ac2e /cmd/gpt.c
parentea5d3731b843b14f1c48d0d0f2c7d2877ecbf673 (diff)
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>
Diffstat (limited to 'cmd/gpt.c')
-rw-r--r--cmd/gpt.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/cmd/gpt.c b/cmd/gpt.c
index b94f0051cd..b8d11c167d 100644
--- a/cmd/gpt.c
+++ b/cmd/gpt.c
@@ -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;
}