From: Björn Jacke Date: Mon, 30 Mar 2009 11:18:34 +0000 (+0200) Subject: s4:ldb: do talloc_free and return NULL when we have no matches to return X-Git-Tag: tdb-1.1.5~919^2~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=488bac4038e12a952fa912b64624facf17d6eff0;p=thirdparty%2Fsamba.git s4:ldb: do talloc_free and return NULL when we have no matches to return --- diff --git a/source4/dsdb/samdb/ldb_modules/anr.c b/source4/dsdb/samdb/ldb_modules/anr.c index a04f5ebfa6f..deeccac072a 100644 --- a/source4/dsdb/samdb/ldb_modules/anr.c +++ b/source4/dsdb/samdb/ldb_modules/anr.c @@ -89,6 +89,7 @@ static struct ldb_parse_tree *make_match_tree(struct ldb_module *module, match_tree->u.substring.chunks = talloc_array(match_tree, struct ldb_val *, 2); if (match_tree->u.substring.chunks == NULL){ + talloc_free(match_tree); ldb_oom(ldb); return NULL; } @@ -99,6 +100,9 @@ static struct ldb_parse_tree *make_match_tree(struct ldb_module *module, match_tree->u.equality.attr = attr; match_tree->u.equality.value = *match; break; + default: + talloc_free(match_tree); + return NULL; } return match_tree; }