[Pkg-libvirt-commits] [libguestfs] 03/66: daemon: parted: part-get-name: Don't leak partition type string.

Hilko Bengen bengen at moszumanska.debian.org
Fri May 9 12:56:19 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch master
in repository libguestfs.

commit dfd18cb438b7f00b68415b295c4373b8984dca2b
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Fri Mar 28 12:35:25 2014 +0000

    daemon: parted: part-get-name: Don't leak partition type string.
    
    Found by './configure --enable-valgrind-daemon'.
    
    This fixes commit 820b87016794116c783bd224f2e776cfdf65108e.
    
    (cherry picked from commit 4cea94a958d72e6f3411ba0caaccf9c27543d15c)
---
 daemon/parted.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/daemon/parted.c b/daemon/parted.c
index 83f2411..fce4cf9 100644
--- a/daemon/parted.c
+++ b/daemon/parted.c
@@ -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;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list