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

[Xen-changelog] [xen-unstable] libxl: Use libxl__realloc in a couple of places in libxl_events.c


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Fri, 26 Oct 2012 01:55:15 +0000
  • Delivery-date: Fri, 26 Oct 2012 01:55:23 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1351181129 -3600
# Node ID e9b8bf4656b99de0b0650a6ed7736a9eb80a5ae3
# Parent  6ccfe4d29f95e3928e57662b1022700078c6967b
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@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r 6ccfe4d29f95 -r e9b8bf4656b9 tools/libxl/libxl_event.c
--- a/tools/libxl/libxl_event.c Thu Oct 25 17:04:37 2012 +0100
+++ b/tools/libxl/libxl_event.c Thu Oct 25 17:05:29 2012 +0100
@@ -489,7 +489,8 @@ int libxl__ev_xswatch_register(libxl__gc
         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__eg
 
         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; }
 

_______________________________________________
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®.