summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb
diff options
context:
space:
mode:
authorBjörn Jacke <bj@sernet.de>2009-03-30 13:18:34 +0200
committerStefan Metzmacher <metze@samba.org>2009-04-22 00:03:22 +0200
commit488bac4038e12a952fa912b64624facf17d6eff0 (patch)
tree643e04b099c695b3bc767d3784e69d9afff3fd99 /source4/dsdb/samdb
parent42e3ae655091d48e5a921969849c6173a498c963 (diff)
downloadsamba-488bac4038e12a952fa912b64624facf17d6eff0.tar.gz
samba-488bac4038e12a952fa912b64624facf17d6eff0.tar.bz2
samba-488bac4038e12a952fa912b64624facf17d6eff0.zip
s4:ldb: do talloc_free and return NULL when we have no matches to return
Diffstat (limited to 'source4/dsdb/samdb')
-rw-r--r--source4/dsdb/samdb/ldb_modules/anr.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/anr.c b/source4/dsdb/samdb/ldb_modules/anr.c
index a04f5ebfa6..deeccac072 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;
}