From: Arran Cudbard-Bell Date: Wed, 4 Dec 2019 07:04:11 +0000 (+0700) Subject: Re-add the context linkage between the FD events and the provided talloc context X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b73bdbffc052b020effdf8f4a39ed01429b93115;p=thirdparty%2Ffreeradius-server.git Re-add the context linkage between the FD events and the provided talloc context Not sure if this was removed or just an omission? --- diff --git a/src/lib/util/event.c b/src/lib/util/event.c index 2e3ece37a09..611268c5a3a 100644 --- a/src/lib/util/event.c +++ b/src/lib/util/event.c @@ -844,6 +844,13 @@ int fr_event_filter_insert(TALLOC_CTX *ctx, fr_event_list_t *el, int fd, return -1; } talloc_set_destructor(ef, _event_fd_delete); + + /* + * Bind the lifetime of the event to the specified + * talloc ctx. If the talloc ctx is freed, the + * event will also be freed. + */ + talloc_link_ctx(ctx, ef); ef->linked_ctx = ctx; ef->el = el;