From bb8d0c76b4f2ad61421f33aae6b268f3de98870f Mon Sep 17 00:00:00 2001
From: Andrew Tridgell <tridge@samba.org>
Date: Mon, 20 Jun 2005 05:21:11 +0000
Subject: r7780: fixed a bug in talloc_find_parent_byname() (This used to be
 commit ee3fe42fb16821eedd564201d953042190f7826f)

---
 source4/lib/talloc/talloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'source4/lib/talloc')

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);
-- 
cgit