summaryrefslogtreecommitdiff
path: root/librpc/ndr
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2017-07-24 11:43:47 -0700
committerJeremy Allison <jra@samba.org>2017-07-26 21:35:21 +0200
commit1c1fce74142f1ba982fee045cdb72938faabe5d5 (patch)
treeb48ff89375150065991dce293e1990a13d83763a /librpc/ndr
parent34ca1b3af46d0e647f1094a75844128a30f61330 (diff)
downloadsamba-1c1fce74142f1ba982fee045cdb72938faabe5d5.tar.gz
lib: rpc: The registered interfaces are a lists of singletons that are never removed.
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>
Diffstat (limited to 'librpc/ndr')
-rw-r--r--librpc/ndr/ndr_table.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/librpc/ndr/ndr_table.c b/librpc/ndr/ndr_table.c
index 3dc158fa7ea..f64e5ac4d20 100644
--- a/librpc/ndr/ndr_table.c
+++ b/librpc/ndr/ndr_table.c
@@ -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);