summaryrefslogtreecommitdiff
path: root/source3/groupdb/mapping_ldb.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-03-28 15:06:56 +0100
committerStefan Metzmacher <metze@samba.org>2008-03-28 19:48:42 +0100
commite191b0edd534d13e9bdbe62a56d41a240f33f001 (patch)
tree3211b169bde9a677239f2a71d032b6f482af2946 /source3/groupdb/mapping_ldb.c
parentd1e99642f731919bce36dd089b000ef4433b4450 (diff)
downloadsamba-e191b0edd534d13e9bdbe62a56d41a240f33f001.tar.gz
mapping_ldb: fix memory leak in group enumeration
metze (This used to be commit 235c056a0ecbb70b21a2572d42c32067dd699988)
Diffstat (limited to 'source3/groupdb/mapping_ldb.c')
-rw-r--r--source3/groupdb/mapping_ldb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/groupdb/mapping_ldb.c b/source3/groupdb/mapping_ldb.c
index 454fe467a97..6775f612e79 100644
--- a/source3/groupdb/mapping_ldb.c
+++ b/source3/groupdb/mapping_ldb.c
@@ -310,7 +310,7 @@ static bool enum_group_mapping(const DOM_SID *domsid, enum lsa_SidType sid_name_
int i, ret;
char *expr;
fstring name;
- struct ldb_result *res;
+ struct ldb_result *res = NULL;
struct ldb_dn *basedn=NULL;
TALLOC_CTX *tmp_ctx;
@@ -333,6 +333,7 @@ static bool enum_group_mapping(const DOM_SID *domsid, enum lsa_SidType sid_name_
}
ret = ldb_search(ldb, basedn, LDB_SCOPE_SUBTREE, expr, NULL, &res);
+ talloc_steal(tmp_ctx, res);
if (ret != LDB_SUCCESS) goto failed;
(*pp_rmap) = NULL;