summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-09-15 09:43:27 -0700
committerAndrew Tridgell <tridge@samba.org>2009-09-15 18:45:41 -0700
commit00fb6705ffc937617e11c6da33b39bad7dda2ac3 (patch)
tree6c743ac2c897b517af88f841ad89f60151c7dfb5 /lib
parent089dc64cbb40fe270d44bed10cfb2ccfacff669a (diff)
downloadsamba-00fb6705ffc937617e11c6da33b39bad7dda2ac3.tar.gz
samba-00fb6705ffc937617e11c6da33b39bad7dda2ac3.tar.xz
samba-00fb6705ffc937617e11c6da33b39bad7dda2ac3.zip
talloc: when we enable NULL tracking, reparent the autofree context
If NULL tracking is enabled after the autofree context is initialised then autofree ends up separate from the null_context. This means that talloc_report_full() doesn't report the autofree context. Fix this by reparenting the autofree context when we create the null_context.
Diffstat (limited to 'lib')
-rw-r--r--lib/talloc/talloc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/talloc/talloc.c b/lib/talloc/talloc.c
index 2709741dfcb..478767c9551 100644
--- a/lib/talloc/talloc.c
+++ b/lib/talloc/talloc.c
@@ -1468,6 +1468,9 @@ void talloc_enable_null_tracking(void)
{
if (null_context == NULL) {
null_context = _talloc_named_const(NULL, 0, "null_context");
+ if (autofree_context != NULL) {
+ talloc_reparent(NULL, null_context, autofree_context);
+ }
}
}