r10529: fix a crash bug in full async code the uses the composite_trigger_done()...
authorStefan Metzmacher <metze@samba.org>
Tue, 27 Sep 2005 10:29:13 +0000 (10:29 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:39:02 +0000 (13:39 -0500)
the event subsystem wants to free timed_events!

metze

source/libcli/composite/composite.c

index 4a5247c9ea9b434c040428df136a99fb6340a018..f6fc61d764c587a0a1483ccac7e4d7e1d25df511 100644 (file)
@@ -52,6 +52,12 @@ static void composite_trigger(struct event_context *ev, struct timed_event *te,
 {
        struct composite_context *c = talloc_get_type(ptr, struct composite_context);
        if (c->async.fn) {
+               /*
+                * the event is a child of req,
+                * and req will be free'ed by the callback fn
+                * but the events code wants to free the event itself
+                */
+               talloc_steal(ev, te);   
                c->async.fn(c);
        }
 }