summaryrefslogtreecommitdiffstats
path: root/lib/waiter
diff options
context:
space:
mode:
authorGeoff Levand <geoffrey.levand@am.sony.com>2009-01-21 16:26:55 -0800
committerJeremy Kerr <jk@ozlabs.org>2009-02-01 11:42:29 +1100
commit6106bb6672af26232546c07a4b631779f21dbbb0 (patch)
treecffc0a8ddb5e65da34dea4204a591bb1b3aa854e /lib/waiter
parent812761a1f8ff94e4913529840b905360ff843fc4 (diff)
downloadpetitboot-6106bb6672af26232546c07a4b631779f21dbbb0.zip
petitboot-6106bb6672af26232546c07a4b631779f21dbbb0.tar.gz
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 <geoffrey.levand@am.sony.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'lib/waiter')
-rw-r--r--lib/waiter/waiter.c3
1 files changed, 2 insertions, 1 deletions
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++) {
OpenPOWER on IntegriCloud