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

[Xen-changelog] [xen-unstable] xl: free the libxl context before exit



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1280499354 -3600
# Node ID 5b52397e10dc658ad0a92f0b5d21f75203d6cd63
# Parent  bb187c5a7fbc73b1e02cc74cdce7eaf26cb4bd80
xl: free the libxl context before exit

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 tools/libxl/xl.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff -r bb187c5a7fbc -r 5b52397e10dc tools/libxl/xl.c
--- a/tools/libxl/xl.c  Fri Jul 30 15:15:24 2010 +0100
+++ b/tools/libxl/xl.c  Fri Jul 30 15:15:54 2010 +0100
@@ -40,6 +40,7 @@ int main(int argc, char **argv)
     int opt = 0;
     char *cmd = 0;
     struct cmd_spec *cspec;
+    int ret;
 
     while ((opt = getopt(argc, argv, "+v")) >= 0) {
         switch (opt) {
@@ -72,12 +73,16 @@ int main(int argc, char **argv)
 
     cspec = cmdtable_lookup(cmd);
     if (cspec)
-        return cspec->cmd_impl(argc, argv);
+        ret = cspec->cmd_impl(argc, argv);
     else if (!strcmp(cmd, "help")) {
         help(argv[optind]);
-        exit(0);
+        ret = 0;
     } else {
         fprintf(stderr, "command not implemented\n");
-        exit(1);
+        ret = 1;
     }
+
+    libxl_ctx_free(&ctx);
+
+    return ret;
 }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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