libfdisk: (gpt) fix memory leak [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2013-03-27 16:15:57 +01:00
parent 985b351ed8
commit c1253a3b10
1 changed files with 3 additions and 1 deletions

View File

@ -1154,8 +1154,10 @@ void gpt_list_table(struct fdisk_context *cxt,
continue;
sizestr = size_to_human_string(SIZE_SUFFIX_1LETTER,
size * cxt->sector_size);
if (!sizestr)
if (!sizestr) {
free(name);
continue;
}
t = fdisk_get_partition_type(cxt, i);