1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

r3028: use talloc_free() instead of talloc_unlink(), as the

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 2d0dfe607d)
This commit is contained in:
Andrew Tridgell 2004-10-18 00:04:46 +00:00 committed by Gerald (Jerry) Carter
parent 260b012f22
commit d37acd0fe7

View File

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