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

[Xen-changelog] [xen-unstable] libxl: remove poller from list in libxl__poller_get



# HG changeset patch
# User Roger Pau Monne <roger.pau@xxxxxxxxxx>
# Date 1334150050 -3600
# Node ID 0dd557cb56724f4d25885c59a416399c762e3eb9
# Parent  081230edcb5e508e622bdd8b806862f76d452e2d
libxl: remove poller from list in libxl__poller_get

Remove poller from the list once it has been requested.
Fixes a double-free bug.

Signed-off-by: Roger Pau Monne <roger.pau@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxx>
Committed-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---


diff -r 081230edcb5e -r 0dd557cb5672 tools/libxl/libxl_event.c
--- a/tools/libxl/libxl_event.c Wed Apr 11 14:14:09 2012 +0100
+++ b/tools/libxl/libxl_event.c Wed Apr 11 14:14:10 2012 +0100
@@ -1010,8 +1010,10 @@ libxl__poller *libxl__poller_get(libxl_c
     int rc;
 
     libxl__poller *p = LIBXL_LIST_FIRST(&ctx->pollers_idle);
-    if (p)
+    if (p) {
+        LIBXL_LIST_REMOVE(p, entry);
         return p;
+    }
 
     p = malloc(sizeof(*p));
     if (!p) {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
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®.