diff mbox

[2/9] petitboot: Fix waiter alloc

Message ID 20090122002653.318873144@am.sony.com
State Accepted
Delegated to: Jeremy Kerr
Headers show

Commit Message

Geoff Levand Jan. 22, 2009, 12:26 a.m. UTC
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>
---
 lib/waiter.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox

Patch

--- a/lib/waiter.c
+++ b/lib/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++) {