From 0941099a2839812b18c2d3db86b18e92b152f1c8 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Wed, 20 Oct 2010 14:27:04 +0200 Subject: ldb:ldb_index.c - fix some memory leaks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Autobuild-User: Matthias Dieter Wallnöfer Autobuild-Date: Wed Oct 20 13:11:49 UTC 2010 on sn-devel-104 --- source4/lib/ldb/ldb_tdb/ldb_index.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source4') diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c index fc2d9a05aa..71cffb90b3 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_index.c +++ b/source4/lib/ldb/ldb_tdb/ldb_index.c @@ -179,6 +179,7 @@ normal_index: ret = ltdb_search_dn1(module, dn, msg); if (ret != LDB_SUCCESS) { + talloc_free(msg); return ret; } @@ -412,7 +413,10 @@ static struct ldb_dn *ltdb_index_key(struct ldb_context *ldb, } if (ldb_should_b64_encode(ldb, &v)) { char *vstr = ldb_base64_encode(ldb, (char *)v.data, v.length); - if (!vstr) return NULL; + if (!vstr) { + talloc_free(attr_folded); + return NULL; + } ret = ldb_dn_new_fmt(ldb, ldb, "%s:%s::%s", LTDB_INDEX, attr_folded, vstr); talloc_free(vstr); } else { @@ -962,6 +966,7 @@ static int ltdb_index_filter(const struct dn_list *dn_list, ret = ldb_module_send_entry(ac->req, msg, NULL); if (ret != LDB_SUCCESS) { + talloc_free(msg); ac->request_terminated = true; return ret; } -- cgit