[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] xl: free default_{vifscript, bridge, gatewaydev} on exit



These leaks aren't serious, since they are only in xl but this makes "xl list"
clean according to valgrind, which is useful from the point of view of
eliminating false positives when looking at the state of libxl (where leaks
matter).

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Cc: George.Dunlap@xxxxxxxxxx
---

I'm inclined to suggest that these are 4.4 material.
---
 tools/libxl/xl.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/xl.c b/tools/libxl/xl.c
index 3c141bf..0f3acb9 100644
--- a/tools/libxl/xl.c
+++ b/tools/libxl/xl.c
@@ -276,6 +276,21 @@ static void xl_ctx_free(void)
         free(lockfile);
         lockfile = NULL;
     }
+
+    if (default_vifscript) {
+        free(default_vifscript);
+        default_vifscript = NULL;
+    }
+
+    if (default_bridge) {
+        free(default_bridge);
+        default_bridge = NULL;
+    }
+
+    if (default_gatewaydev) {
+        free(default_gatewaydev);
+        default_gatewaydev = NULL;
+    }
 }
 
 int main(int argc, char **argv)
-- 
1.7.2.5


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.