From: Ian Jackson Subject: Re: [PATCH] libxl: Use libxl__realloc in a couple of places in libxl_events.c Date: Fri, 19 Oct 2012 11:54:06 +0100 Message-ID: <20609.12622.366009.448395@mariner.uk.xensource.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org Ian Campbell writes ("[PATCH] libxl: Use libxl__realloc in a couple of places in libxl_events.c"): > 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. As far as it goes, Acked-by: Ian Jackson But... > Signed-off-by: Ian Campbell > > diff -r 33487389f7f2 -r fd0989ae4407 tools/libxl/libxl_event.c > --- a/tools/libxl/libxl_event.c Tue Oct 16 16:45:43 2012 +0100 > +++ b/tools/libxl/libxl_event.c Tue Oct 16 16:46:18 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; So did you want to remove the error exits then too ? > - realloc(poller->fd_polls, sizeof(*newarray) * nfds); > + libxl__realloc(NOGC, poller->fd_polls, sizeof(*newarray) * nfds); > > if (!newarray) { rc = ERROR_NOMEM; goto out; } And here. Ian.