daemon: parted: part-get-name: Don't leak partition type string.

Found by './configure --enable-valgrind-daemon'.

This fixes commit 820b870167.
This commit is contained in:
Richard W.M. Jones
2014-03-28 12:35:25 +00:00
parent a7a239f7ab
commit 4cea94a958

View File

@@ -917,10 +917,12 @@ do_part_get_gpt_type (const char *device, int partnum)
char *
do_part_get_name (const char *device, int partnum)
{
char *parttype = do_part_get_parttype (device);
CLEANUP_FREE char *parttype = do_part_get_parttype (device);
if (STREQ (parttype, "gpt"))
return sgdisk_info_extract_field (device, partnum,
"Partition name", extract_optionally_quoted);
"Partition name",
extract_optionally_quoted);
reply_with_error ("cannot get the partition name from '%s' layouts", parttype);
return NULL;