From: Geoff Levand Date: Thu, 22 Jan 2009 00:26:55 +0000 (-0800) Subject: Fix waiter alloc X-Git-Tag: v1.0.0~929 X-Git-Url: https://git.ozlabs.org/?p=petitboot;a=commitdiff_plain;h=6106bb6672af26232546c07a4b631779f21dbbb0 Fix waiter alloc Add the missing assignment of the global n_pollfds variable. Fix a minor memory leak in waiter_poll(). Signed-off-by: Geoff Levand Signed-off-by: Jeremy Kerr --- diff --git a/lib/waiter/waiter.c b/lib/waiter/waiter.c index 21dd4a5..214dfda 100644 --- a/lib/waiter/waiter.c +++ b/lib/waiter/waiter.c @@ -54,9 +54,10 @@ int waiter_poll(void) static int n_pollfds; int i, rc; - if (n_waiters > n_pollfds) { + if (n_waiters != n_pollfds) { pollfds = talloc_realloc(NULL, pollfds, struct pollfd, n_waiters); + n_pollfds = n_waiters; } for (i = 0; i < n_waiters; i++) {