lib: rpc: The registered interfaces are a lists of singletons that are never removed.
authorJeremy Allison <jra@samba.org>
Mon, 24 Jul 2017 18:43:47 +0000 (11:43 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 26 Jul 2017 19:35:21 +0000 (21:35 +0200)
Allocate them off the NULL context not the talloc_autofree_context().

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12932

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
librpc/ndr/ndr_table.c

index 3dc158fa7ead5ecf0e8f0755197d27db9dea1778..f64e5ac4d20afdfe46a68ea603f6f54eb5ac37c4 100644 (file)
@@ -44,7 +44,17 @@ NTSTATUS ndr_table_register(const struct ndr_interface_table *table)
                }
        }
 
-       l = talloc(talloc_autofree_context(), struct ndr_interface_list);
+       /*
+        * This is a singleton instance guarenteed
+        * by the above check to be only added once
+        * into the list so we can allocate off the NULL
+        * context. We never want this to be freed
+        * until process shutdown. If needed we could
+        * add a deregister function that walks and
+        * frees the list.
+        */
+
+       l = talloc(NULL, struct ndr_interface_list);
        l->table = table;
 
        DLIST_ADD(ndr_interfaces, l);