From 7b5913b6334eb8d36ccbe258d323bb9921571202 Mon Sep 17 00:00:00 2001 From: Saji VR Date: Wed, 4 May 2016 15:14:55 -0700 Subject: [PATCH] lib:talloc. Fix memory leak when destructors reparent children. If a destructor reparents a child, we shouldn't exit the loop freeing children as there may be others to process. https://bugzilla.samba.org/show_bug.cgi?id=11901 Signed-off-by: Saji VR Reviewed-by: Jeremy Allison --- lib/talloc/talloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/talloc/talloc.c b/lib/talloc/talloc.c index 90b9d96..48d2033 100644 --- a/lib/talloc/talloc.c +++ b/lib/talloc/talloc.c @@ -1528,7 +1528,7 @@ static inline void _talloc_free_children_internal(struct talloc_chunk *tc, * Destructor already reparented this child. * No further reparenting needed. */ - return; + continue; } if (new_parent == null_context) { struct talloc_chunk *p = talloc_parent_chunk(ptr); -- 2.8.0.rc3.226.g39d4020