summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-10-23 15:11:08 +0200
committerStefan Metzmacher <metze@samba.org>2009-10-24 11:59:15 +0200
commit69e96f08f1def1c28abe928ccbb0717566e49c8c (patch)
treebd6183b50d932ada64c61be2ae970680dc0a2ca8 /source4
parentdc8e681755242b21bfb0e2d0cade633542ba7c81 (diff)
downloadsamba-69e96f08f1def1c28abe928ccbb0717566e49c8c.tar.gz
samba-69e96f08f1def1c28abe928ccbb0717566e49c8c.tar.bz2
samba-69e96f08f1def1c28abe928ccbb0717566e49c8c.zip
s4:dsdb/partition_init: don't leak a talloc_new() in case we have no data yet
metze
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/samdb/ldb_modules/partition_init.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/partition_init.c b/source4/dsdb/samdb/ldb_modules/partition_init.c
index cc778d6a71..28eab9b2ee 100644
--- a/source4/dsdb/samdb/ldb_modules/partition_init.c
+++ b/source4/dsdb/samdb/ldb_modules/partition_init.c
@@ -353,22 +353,25 @@ static int add_partition_to_data(struct ldb_context *ldb, struct partition_priva
int partition_reload_if_required(struct ldb_module *module,
struct partition_private_data *data)
-
{
uint64_t seq;
int ret, i;
struct ldb_context *ldb = ldb_module_get_ctx(module);
struct ldb_message *msg;
struct ldb_message_element *partition_attributes;
- TALLOC_CTX *mem_ctx = talloc_new(data);
+ TALLOC_CTX *mem_ctx;
+
if (!data) {
/* Not initilised yet */
return LDB_SUCCESS;
}
+
+ mem_ctx = talloc_new(data);
if (!mem_ctx) {
ldb_oom(ldb);
return LDB_ERR_OPERATIONS_ERROR;
}
+
ret = partition_primary_sequence_number(module, mem_ctx, LDB_SEQ_HIGHEST_SEQ, &seq);
if (ret != LDB_SUCCESS) {
talloc_free(mem_ctx);