]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Re-add the context linkage between the FD events and the provided talloc context
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 4 Dec 2019 07:04:11 +0000 (14:04 +0700)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 4 Dec 2019 07:04:35 +0000 (14:04 +0700)
Not sure if this was removed or just an omission?

src/lib/util/event.c

index 2e3ece37a098cf3671326eb99443ffc8298723d7..611268c5a3a4225a28aacd1badfe2343c0e4fe08 100644 (file)
@@ -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;