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

[Xen-changelog] [xen master] libxl: fix double free when doing xl save



commit b29f4c1e37c78874048a34700a967973bb31fbf9
Author:     Juergen Gross <jgross@xxxxxxxx>
AuthorDate: Thu Jul 28 09:21:43 2016 +0200
Commit:     Wei Liu <wei.liu2@xxxxxxxxxx>
CommitDate: Thu Jul 28 10:37:30 2016 +0100

    libxl: fix double free when doing xl save
    
    Commit d2412fd63b14c6c21d0a3d4367afa448425dfb8a ("libxl: move common
    nic stuff into one source") introduced a double free error in libxl
    which occurred during "xl save".
    
    Correct this error.
    
    Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
    Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 tools/libxl/libxl.c     | 2 +-
 tools/libxl/libxl_nic.c | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 278285a..760ebca 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -3228,7 +3228,7 @@ static int libxl__device_channel_from_xenstore(libxl__gc 
*gc,
                                 GCSPRINTF("%s/name", libxl_path),
                                 (const char **)(&channel->name));
     if (rc) goto out;
-    rc = libxl__xs_read_checked(NOGC, XBT_NULL,
+    rc = libxl__xs_read_checked(gc, XBT_NULL,
                                 GCSPRINTF("%s/connection", libxl_path), &tmp);
     if (rc) goto out;
     if (!strcmp(tmp, "pty")) {
diff --git a/tools/libxl/libxl_nic.c b/tools/libxl/libxl_nic.c
index ff1834f..c34b7ba 100644
--- a/tools/libxl/libxl_nic.c
+++ b/tools/libxl/libxl_nic.c
@@ -321,19 +321,19 @@ static int libxl__device_nic_from_xenstore(libxl__gc *gc,
         memset(nic->mac, 0, sizeof(nic->mac));
     }
 
-    rc = libxl__xs_read_checked(gc, XBT_NULL,
+    rc = libxl__xs_read_checked(NOGC, XBT_NULL,
                                 GCSPRINTF("%s/ip", libxl_path),
                                 (const char **)(&nic->ip));
     if (rc) goto out;
-    rc = libxl__xs_read_checked(gc, XBT_NULL,
+    rc = libxl__xs_read_checked(NOGC, XBT_NULL,
                                 GCSPRINTF("%s/bridge", libxl_path),
                                 (const char **)(&nic->bridge));
     if (rc) goto out;
-    rc = libxl__xs_read_checked(gc, XBT_NULL,
+    rc = libxl__xs_read_checked(NOGC, XBT_NULL,
                                 GCSPRINTF("%s/script", libxl_path),
                                 (const char **)(&nic->script));
     if (rc) goto out;
-    rc = libxl__xs_read_checked(gc, XBT_NULL,
+    rc = libxl__xs_read_checked(NOGC, XBT_NULL,
                                 GCSPRINTF("%s/forwarddev", libxl_path),
                                 (const char **)(&nic->coloft_forwarddev));
     if (rc) goto out;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

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