From 45171d61083339a624a83a1412602475ce7978a6 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Sat, 5 Jun 2010 17:45:51 +0200 Subject: s4:ridalloc LDB module - add more "talloc_free"s where useful Some were missing on failure return branches. --- source4/dsdb/samdb/ldb_modules/ridalloc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source4/dsdb/samdb/ldb_modules/ridalloc.c b/source4/dsdb/samdb/ldb_modules/ridalloc.c index 05aee77638..e54d6b4954 100644 --- a/source4/dsdb/samdb/ldb_modules/ridalloc.c +++ b/source4/dsdb/samdb/ldb_modules/ridalloc.c @@ -194,11 +194,13 @@ static int ridalloc_create_rid_set_ntds(struct ldb_module *module, TALLOC_CTX *m rid_set_dn = ldb_dn_copy(tmp_ctx, machine_dn); if (rid_set_dn == NULL) { ldb_module_oom(module); + talloc_free(tmp_ctx); return LDB_ERR_OPERATIONS_ERROR; } if (! ldb_dn_add_child_fmt(rid_set_dn, "CN=RID Set")) { ldb_module_oom(module); + talloc_free(tmp_ctx); return LDB_ERR_OPERATIONS_ERROR; } @@ -507,6 +509,7 @@ int ridalloc_allocate_rid(struct ldb_module *module, uint32_t *rid) uint64_t new_pool; ret = ridalloc_refresh_own_pool(module, &new_pool); if (ret != LDB_SUCCESS) { + talloc_free(tmp_ctx); return ret; } ret = dsdb_module_constrainted_update_integer(module, rid_set_dn, "rIDPreviousAllocationPool", -- cgit