r3028: use talloc_free() instead of talloc_unlink(), as the
authorAndrew Tridgell <tridge@samba.org>
Mon, 18 Oct 2004 00:04:46 +0000 (00:04 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:59:59 +0000 (12:59 -0500)
event_context_merge() code leaves the events as grandchildren of the
events context, not children, so talloc_unlink() will not work after
the merge
(This used to be commit 2d0dfe607dcfb522669d6fb3d566cf121d84274a)

source4/lib/events.c

index 2cedfc083c8f1569bc51cca92b2683de365b3ba4..dac23ec6bc11ea72c5e55b38f152cbe98bcf6f46 100644 (file)
@@ -297,7 +297,7 @@ int event_loop_once(struct event_context *ev)
                struct loop_event *next = le->next;
                if (le->ref_count == 0) {
                        DLIST_REMOVE(ev->loop_events, le);
-                       talloc_unlink(ev->events, le);
+                       talloc_free(le);
                } else {
                        le->ref_count++;
                        le->handler(ev, le, t);
@@ -318,7 +318,7 @@ int event_loop_once(struct event_context *ev)
                        if (ev->maxfd == fe->fd) {
                                ev->maxfd = EVENT_INVALID_MAXFD;
                        }
-                       talloc_unlink(ev->events, fe);
+                       talloc_free(fe);
                } else {
                        if (fe->flags & EVENT_FD_READ) {
                                FD_SET(fe->fd, &r_fds);
@@ -399,7 +399,7 @@ int event_loop_once(struct event_context *ev)
                struct timed_event *next = te->next;
                if (te->ref_count == 0) {
                        DLIST_REMOVE(ev->timed_events, te);
-                       talloc_unlink(ev->events, te);
+                       talloc_free(te);
                } else if (te->next_event <= t) {
                        te->ref_count++;
                        te->handler(ev, te, t);