From 6281cacd1fc7d63000f74496da0c32b76e90cdbd Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Thu, 25 Oct 2012 17:05:29 +0100 Subject: 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 Acked-by: Ian Jackson Committed-by: Ian Jackson --- tools/libxl/libxl_event.c | 5 +++-- 1 file 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; } -- cgit v1.2.3