[Libguestfs] [PATCH 10/14] daemon: Fix leak of strings in md-detail (found by valgrind).

Richard W.M. Jones rjones at redhat.com
Tue Jan 24 17:02:24 UTC 2012


From: "Richard W.M. Jones" <rjones at redhat.com>

---
 daemon/md.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/daemon/md.c b/daemon/md.c
index fea3cf4..f6dc603 100644
--- a/daemon/md.c
+++ b/daemon/md.c
@@ -297,7 +297,7 @@ do_md_detail(const char *md)
 
   free (out);
   free (err);
-  free (lines); /* We freed the contained strings when we freed out */
+  free_strings (lines);
 
   if (add_string (&ret, &size, &alloc, NULL) == -1) return NULL;
 
@@ -307,7 +307,7 @@ error:
   free (out);
   free (err);
   if (lines)
-    free (lines);
+    free_strings (lines);
   if (ret)
     free_strings (ret);
 
-- 
1.7.6




More information about the Libguestfs mailing list