From 6106bb6672af26232546c07a4b631779f21dbbb0 Mon Sep 17 00:00:00 2001 From: Geoff Levand Date: Wed, 21 Jan 2009 16:26:55 -0800 Subject: [PATCH] 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 --- lib/waiter/waiter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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++) { -- 2.39.2