summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-10-20 14:27:04 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-10-20 13:11:49 +0000
commit0941099a2839812b18c2d3db86b18e92b152f1c8 (patch)
tree310780810b44f87bed9bec6ed47fd3da939bfb70 /source4
parent3bf8ca67900a10e608808535358a148455827a2e (diff)
downloadsamba-0941099a2839812b18c2d3db86b18e92b152f1c8.tar.gz
samba-0941099a2839812b18c2d3db86b18e92b152f1c8.tar.bz2
samba-0941099a2839812b18c2d3db86b18e92b152f1c8.zip
ldb:ldb_index.c - fix some memory leaks
Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date: Wed Oct 20 13:11:49 UTC 2010 on sn-devel-104
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_index.c7
1 files changed, 6 insertions, 1 deletions
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;
}