lib/waiter: talloc waiters from waitset context
authorJeremy Kerr <jk@ozlabs.org>
Wed, 14 Aug 2013 06:55:46 +0000 (14:55 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Fri, 16 Aug 2013 06:41:08 +0000 (14:41 +0800)
We can lose a reference to the first waiter allocated, as set->waiters
may be NULL.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
lib/waiter/waiter.c

index 13b0d68fc05ac6a32a03aea748377d0da03c226e..833f63b856a035d7a49adb724bacceeb2553521d 100644 (file)
@@ -66,7 +66,7 @@ static struct waiter *waiter_new(struct waitset *set)
 {
        struct waiter **waiters, *waiter;
 
-       waiter = talloc(set->waiters, struct waiter);
+       waiter = talloc(set, struct waiter);
        if (!waiter)
                return NULL;