git.samba.org
/
ira
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0fb6e2a
)
s4-ldb: fixed some memory leaks in new indexing code
author
Andrew Tridgell
<tridge@samba.org>
Thu, 22 Oct 2009 01:45:26 +0000
(12:45 +1100)
committer
Andrew Tridgell
<tridge@samba.org>
Thu, 22 Oct 2009 01:47:55 +0000
(12:47 +1100)
source4/lib/ldb/ldb_tdb/ldb_index.c
patch
|
blob
|
history
diff --git
a/source4/lib/ldb/ldb_tdb/ldb_index.c
b/source4/lib/ldb/ldb_tdb/ldb_index.c
index a28e97256fcdc2979f22a3d94da10b4770f7791b..04c3c7acce69a9130e134ff59a5c863aba9fe81a 100644
(file)
--- 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) {
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;
}
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) {
if (list->count > 0 &&
a->flags & LDB_ATTR_FLAG_UNIQUE_INDEX) {
+ talloc_free(list);
return LDB_ERR_ENTRY_ALREADY_EXISTS;
}
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;
}
return 0;
}
- msg =
talloc(module, struct ldb_messag
e);
+ msg =
ldb_msg_new(modul
e);
if (msg == NULL) {
return -1;
}
if (msg == NULL) {
return -1;
}