summaryrefslogtreecommitdiff
path: root/source4/lib/ldb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-10-22 12:45:26 +1100
committerAndrew Tridgell <tridge@samba.org>2009-10-22 12:47:55 +1100
commitf2988f5cad156da54e7ad41c2c2d8bd7a0ee29b8 (patch)
tree27c805b07f7249ad7038f6b998347c4d0137582c /source4/lib/ldb
parent0fb6e2a52cb681cfdd73c4be16487d1d9d7d8318 (diff)
downloadsamba-f2988f5cad156da54e7ad41c2c2d8bd7a0ee29b8.tar.gz
samba-f2988f5cad156da54e7ad41c2c2d8bd7a0ee29b8.tar.bz2
samba-f2988f5cad156da54e7ad41c2c2d8bd7a0ee29b8.zip
s4-ldb: fixed some memory leaks in new indexing code
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_index.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c
index a28e97256f..04c3c7acce 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_index.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_index.c
@@ -215,6 +215,7 @@ static int ltdb_dn_list_store_full(struct ldb_module *module, struct ldb_dn *dn,
ret = ldb_msg_add_fmt(msg, LTDB_IDXVERSION, "%u", LTDB_INDEXING_VERSION);
if (ret != LDB_SUCCESS) {
+ talloc_free(msg);
ldb_module_oom(module);
return LDB_ERR_OPERATIONS_ERROR;
}
@@ -1094,6 +1095,7 @@ static int ltdb_index_add1(struct ldb_module *module, const char *dn,
if (list->count > 0 &&
a->flags & LDB_ATTR_FLAG_UNIQUE_INDEX) {
+ talloc_free(list);
return LDB_ERR_ENTRY_ALREADY_EXISTS;
}
@@ -1424,7 +1426,7 @@ static int re_index(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, void *
return 0;
}
- msg = talloc(module, struct ldb_message);
+ msg = ldb_msg_new(module);
if (msg == NULL) {
return -1;
}