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] libxl: Fix blktap2 for xl cset 21586:c3c2

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] libxl: Fix blktap2 for xl cset 21586:c3c2bcafe471
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 11 Jun 2010 07:25:21 -0700
Delivery-date: Fri, 11 Jun 2010 07:27:05 -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 Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1276245325 -3600
# Node ID 630956366c2c992fa76f9a3e70c00c3f6ad3c39e
# Parent  a822156d9fbb706d25016bb3e067faac005254b4
libxl: Fix blktap2 for xl cset 21586:c3c2bcafe471

Avoids a double free on automatic memory.

Signed-off-by: Daniel Stodden <daniel.stodden@xxxxxxxxxx>
---
 tools/libxl/libxl.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff -r a822156d9fbb -r 630956366c2c tools/libxl/libxl.c
--- a/tools/libxl/libxl.c       Fri Jun 11 09:34:58 2010 +0100
+++ b/tools/libxl/libxl.c       Fri Jun 11 09:35:25 2010 +0100
@@ -1253,13 +1253,15 @@ static char *make_blktap2_device(struct 
 static char *make_blktap2_device(struct libxl_ctx *ctx,
                                 const char *name, const char *type)
 {
-    char *params, *devname;
+    char *params, *devname = NULL, *rv = NULL;
     int err;
     params = libxl_sprintf(ctx, "%s:%s", type, name);
-    devname = NULL;
     err = tap_ctl_create(params, &devname);
-    free(params);
-    return err ? NULL : devname;
+    if (!err) {
+        rv = libxl_sprintf(ctx, devname);
+        free(devname);
+    }
+    return rv;
 }
 
 int libxl_device_disk_add(struct libxl_ctx *ctx, uint32_t domid, 
libxl_device_disk *disk)

_______________________________________________
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] libxl: Fix blktap2 for xl cset 21586:c3c2bcafe471, Xen patchbot-unstable <=