summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/lib/talloc/talloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source4/lib/talloc/talloc.c b/source4/lib/talloc/talloc.c
index 823ae4ffb3..67478fc9d4 100644
--- a/source4/lib/talloc/talloc.c
+++ b/source4/lib/talloc/talloc.c
@@ -698,7 +698,7 @@ void *talloc_steal(const void *new_ctx, const void *ptr)
new_tc = talloc_chunk_from_ptr(new_ctx);
- if (tc == new_tc) {
+ if (tc == new_tc || tc->parent == new_tc) {
return discard_const_p(void, ptr);
}