s4:ridalloc LDB module - add more "talloc_free"s where useful
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Sat, 5 Jun 2010 15:45:51 +0000 (17:45 +0200)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Sun, 6 Jun 2010 18:44:01 +0000 (20:44 +0200)
Some were missing on failure return branches.

source4/dsdb/samdb/ldb_modules/ridalloc.c

index 05aee7763883875384dca4489ee750fef14f6869..e54d6b4954374be68b496db5c75951579f743638 100644 (file)
@@ -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",