]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
cmd: gpt: remove bogus code leftover from merge conflict resolution
authorLothar Waßmann <LW@KARO-electronics.de>
Thu, 9 May 2019 13:55:14 +0000 (15:55 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Thu, 9 May 2019 13:55:14 +0000 (15:55 +0200)
and fix leaking memory for str_disk_guid in case of error.

common/cmd_gpt.c

index 1feb41d93c75d8ffc92a4a2197570391c32ab0ae..f401209f7ffcfa30c87be97527458cd8ae2b5869 100644 (file)
@@ -141,7 +141,6 @@ static int set_gpt_info(block_dev_desc_t *dev_desc,
        char *val, *p;
        int p_count;
        disk_partition_t *parts;
        char *val, *p;
        int p_count;
        disk_partition_t *parts;
-       char *guid_str;
        int errno = 0;
        uint64_t size_ll, start_ll;
 
        int errno = 0;
        uint64_t size_ll, start_ll;
 
@@ -259,7 +258,6 @@ static int set_gpt_info(block_dev_desc_t *dev_desc,
                }
        }
 
                }
        }
 
-       *str_disk_guid = guid_str;
        *parts_count = p_count;
        *partitions = parts;
        free(str);
        *parts_count = p_count;
        *partitions = parts;
        free(str);
@@ -267,10 +265,8 @@ static int set_gpt_info(block_dev_desc_t *dev_desc,
        return 0;
 
 err:
        return 0;
 
 err:
+       free(*str_disk_guid);
        free(parts);
        free(parts);
-free_guid:
-       free(guid_str);
-free_str:
        free(str);
 
        *str_disk_guid = NULL;
        free(str);
 
        *str_disk_guid = NULL;