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 c6f748ea3b..9dd7ef36c7 100644
--- a/source4/lib/talloc/talloc.c
+++ b/source4/lib/talloc/talloc.c
@@ -1127,7 +1127,7 @@ void *talloc_find_parent_byname(const void *context, const char *name)
while (tc->parent && (!tc->name || strcmp(tc->name, name))) {
tc = tc->parent;
}
- if (tc == NULL) {
+ if (tc == NULL || tc->name == NULL || strcmp(tc->name, name)) {
return NULL;
}
return (void *)(tc+1);