diff options
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/talloc/talloc.c | 8 | ||||
-rw-r--r-- | source4/lib/talloc/testsuite.c | 3 |
2 files changed, 4 insertions, 7 deletions
diff --git a/source4/lib/talloc/talloc.c b/source4/lib/talloc/talloc.c index ab199678c1..05bc09a21e 100644 --- a/source4/lib/talloc/talloc.c +++ b/source4/lib/talloc/talloc.c @@ -585,10 +585,6 @@ int talloc_free(void *ptr) tc->destructor = NULL; } - tc->flags |= TALLOC_FLAG_LOOP; - - talloc_free_children(ptr); - if (tc->parent) { _TLIST_REMOVE(tc->parent->child, tc); if (tc->parent->child) { @@ -599,8 +595,10 @@ int talloc_free(void *ptr) if (tc->next) tc->next->prev = tc->prev; } - tc->flags |= TALLOC_FLAG_FREE; + tc->flags |= TALLOC_FLAG_LOOP; + talloc_free_children(ptr); + tc->flags |= TALLOC_FLAG_FREE; old_errno = errno; free(tc); errno = old_errno; diff --git a/source4/lib/talloc/testsuite.c b/source4/lib/talloc/testsuite.c index 477d9a5848..2b04f66fc4 100644 --- a/source4/lib/talloc/testsuite.c +++ b/source4/lib/talloc/testsuite.c @@ -845,9 +845,8 @@ static BOOL test_lifeless(void) talloc_report_full(top, stdout); talloc_free(top); talloc_free(child_owner); -#if 0 talloc_free(child); -#endif + return True; } |