WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] tools/libxl: fix leak in libxl_wait_for_b

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] tools/libxl: fix leak in libxl_wait_for_backend()
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 18 Aug 2010 07:01:23 -0700
Delivery-date: Wed, 18 Aug 2010 07:08:36 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Gianni Tedesco <gianni.tedesco@xxxxxxxxxx>
# Date 1282062205 -3600
# Node ID ca50b3d02b29b4d153b163921c7dc147bfcb6cfe
# Parent  e5a9221bdd3fec99bc4b01afe56ef639cc9be60a
tools/libxl: fix leak in libxl_wait_for_backend()

Another leak was been introduced since the gc patch-set.

Signed-off-by: Gianni Tedesco <gianni.tedesco@xxxxxxxxxx>
Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 tools/libxl/libxl_device.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff -r e5a9221bdd3f -r ca50b3d02b29 tools/libxl/libxl_device.c
--- a/tools/libxl/libxl_device.c        Tue Aug 17 17:20:53 2010 +0100
+++ b/tools/libxl/libxl_device.c        Tue Aug 17 17:23:25 2010 +0100
@@ -457,6 +457,7 @@ int libxl_wait_for_backend(libxl_ctx *ct
     unsigned int len;
     char *p;
     char *path = libxl_sprintf(&gc, "%s/state", be_path);
+    int rc = -1;
 
     while (watchdog > 0) {
         p = xs_read(ctx->xsh, XBT_NULL, path, &len);
@@ -468,10 +469,11 @@ int libxl_wait_for_backend(libxl_ctx *ct
                 XL_LOG_ERRNO(ctx, XL_LOG_ERROR, "Failed to access backend %s",
                        be_path);
             }
-            return -1;
+            goto out;
         } else {
             if (!strcmp(p, state)) {
-                return 0;
+                rc = 0;
+                goto out;
             } else {
                 usleep(100000);
                 watchdog--;
@@ -479,7 +481,8 @@ int libxl_wait_for_backend(libxl_ctx *ct
         }
     }
     XL_LOG(ctx, XL_LOG_ERROR, "Backend %s not ready", be_path);
-    libxl_free_all(&gc);
-    return -1;
-}
-
+out:
+    libxl_free_all(&gc);
+    return rc;
+}
+

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] tools/libxl: fix leak in libxl_wait_for_backend(), Xen patchbot-unstable <=