diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2012-10-25 17:05:29 +0100 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2012-10-25 17:05:29 +0100 |
commit | 6281cacd1fc7d63000f74496da0c32b76e90cdbd (patch) | |
tree | 02cff005bbd732644b3eb86730e32b8e2dd0e5e7 /tools/libxl/libxl_event.c | |
parent | f9ea792edccc5832eb92917ba87c46eccca42a0d (diff) | |
download | xen-6281cacd1fc7d63000f74496da0c32b76e90cdbd.tar.gz xen-6281cacd1fc7d63000f74496da0c32b76e90cdbd.tar.bz2 xen-6281cacd1fc7d63000f74496da0c32b76e90cdbd.zip |
libxl: Use libxl__realloc in a couple of places in libxl_events.c
This avoids us having to think about the error handling on failure.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.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.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c index e9e2fdc277..41fd5bbfe6 100644 --- a/tools/libxl/libxl_event.c +++ b/tools/libxl/libxl_event.c @@ -489,7 +489,8 @@ int libxl__ev_xswatch_register(libxl__gc *gc, libxl__ev_xswatch *w, int newarraysize = (CTX->watch_nslots + 1) << 2; int i; libxl__ev_watch_slot *newarray = - realloc(CTX->watch_slots, sizeof(*newarray) * newarraysize); + libxl__realloc(NOGC, + CTX->watch_slots, sizeof(*newarray) * newarraysize); if (!newarray) goto out_nomem; for (i = CTX->watch_nslots; i < newarraysize; i++) LIBXL_SLIST_INSERT_HEAD(&CTX->watch_freeslots, @@ -1343,7 +1344,7 @@ static int eventloop_iteration(libxl__egc *egc, libxl__poller *poller) { struct pollfd *newarray = (nfds > INT_MAX / sizeof(struct pollfd) / 2) ? 0 : - realloc(poller->fd_polls, sizeof(*newarray) * nfds); + libxl__realloc(NOGC, poller->fd_polls, sizeof(*newarray) * nfds); if (!newarray) { rc = ERROR_NOMEM; goto out; } |