[Pkg-libvirt-commits] [libguestfs] 06/66: rescue: Don't leak various variables when using --suggest option with multi-boot guests.

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 d3483535bd4aa5dc7ada24d500940b490707cca0
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Fri Mar 28 14:25:42 2014 +0000

    rescue: Don't leak various variables when using --suggest option with multi-boot guests.
    
    This fixes a leak which was introduced in
    commit 4255db65e58a86148ec291a7416a1148c453d926.
    
    Found by Coverity.
    
    (cherry picked from commit c8657535fd6c937a4ce9ebee647b03b8b6f76916)
---
 rescue/rescue.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/rescue/rescue.c b/rescue/rescue.c
index b46dad6..d0c6207 100644
--- a/rescue/rescue.c
+++ b/rescue/rescue.c
@@ -384,10 +384,7 @@ static void
 do_suggestion (struct drv *drvs)
 {
   CLEANUP_FREE_STRING_LIST char **roots = NULL;
-  size_t i, j;
-  CLEANUP_FREE char *type = NULL, *distro = NULL, *product_name = NULL;
-  int major, minor;
-  CLEANUP_FREE_STRING_LIST char **mps = NULL;
+  size_t i;
 
   /* For inspection, force add_drives to add the drives read-only. */
   read_only = 1;
@@ -421,6 +418,11 @@ do_suggestion (struct drv *drvs)
             "commands in virt-rescue (at the ><rescue> prompt) to mount the filesystems.\n\n"));
 
   for (i = 0; roots[i] != NULL; ++i) {
+    CLEANUP_FREE_STRING_LIST char **mps = NULL;
+    CLEANUP_FREE char *type = NULL, *distro = NULL, *product_name = NULL;
+    int major, minor;
+    size_t j;
+
     type = guestfs_inspect_get_type (g, roots[i]);
     distro = guestfs_inspect_get_distro (g, roots[i]);
     product_name = guestfs_inspect_get_product_name (g, roots[i]);

-- 
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