diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-09-15 09:43:27 -0700 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-09-15 14:52:00 -0700 |
commit | 6a9c89b3aef02310030ff436cd545eef77b8d1ee (patch) | |
tree | 8e5aac2acdcd60d57a912df06eb0d6788cf06b2a | |
parent | 451a537caa2207bb5e0a8818326a5f164c0d559a (diff) | |
download | samba-6a9c89b3aef02310030ff436cd545eef77b8d1ee.tar.gz samba-6a9c89b3aef02310030ff436cd545eef77b8d1ee.tar.bz2 samba-6a9c89b3aef02310030ff436cd545eef77b8d1ee.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.
-rw-r--r-- | lib/talloc/talloc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/talloc/talloc.c b/lib/talloc/talloc.c index 2709741dfc..478767c955 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); + } } } |