aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl_event.c
diff options
context:
space:
mode:
authorRoger Pau Monne <roger.pau@citrix.com>2012-04-11 14:14:10 +0100
committerRoger Pau Monne <roger.pau@citrix.com>2012-04-11 14:14:10 +0100
commitd8ee40befca173f74174159970340143cb372b6b (patch)
tree5b31923da12d9f82a448045e54e1b3a6331c9efc /tools/libxl/libxl_event.c
parentea68af3ef75f911a26eaf717be3c4b73084597ec (diff)
downloadxen-d8ee40befca173f74174159970340143cb372b6b.tar.gz
xen-d8ee40befca173f74174159970340143cb372b6b.tar.bz2
xen-d8ee40befca173f74174159970340143cb372b6b.zip
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@citrix.com> Acked-by: Ian Jackson <ian.jackson@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl/libxl_event.c')
-rw-r--r--tools/libxl/libxl_event.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c
index 5ac6334c1a..9cb172aef2 100644
--- a/tools/libxl/libxl_event.c
+++ b/tools/libxl/libxl_event.c
@@ -1010,8 +1010,10 @@ libxl__poller *libxl__poller_get(libxl_ctx *ctx)
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) {