From a0d4c1e127e1d2b57b0d823dec5e0cf710aef0ce Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 17 Mar 2008 01:02:47 +0100 Subject: registry: allocate tempory data in talloc stack in regdb_store_keys(). Michael (This used to be commit a99b51159a7db5f249ff136cf9ba758d14380a35) --- source3/registry/reg_backend_db.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'source3/registry') diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c index 8bfa3526ea..8a859301f0 100644 --- a/source3/registry/reg_backend_db.c +++ b/source3/registry/reg_backend_db.c @@ -467,7 +467,7 @@ bool regdb_store_keys(const char *key, REGSUBKEY_CTR *ctr) * changed */ - if (!(old_subkeys = TALLOC_ZERO_P(ctr, REGSUBKEY_CTR))) { + if (!(old_subkeys = TALLOC_ZERO_P(ctx, REGSUBKEY_CTR))) { DEBUG(0,("regdb_store_keys: talloc() failure!\n")); return false; } @@ -504,7 +504,7 @@ bool regdb_store_keys(const char *key, REGSUBKEY_CTR *ctr) * Re-fetch the old keys inside the transaction */ - if (!(old_subkeys = TALLOC_ZERO_P(ctr, REGSUBKEY_CTR))) { + if (!(old_subkeys = TALLOC_ZERO_P(ctx, REGSUBKEY_CTR))) { DEBUG(0,("regdb_store_keys: talloc() failure!\n")); goto cancel; } @@ -574,7 +574,7 @@ bool regdb_store_keys(const char *key, REGSUBKEY_CTR *ctr) num_subkeys = regsubkey_ctr_numkeys(ctr); if (num_subkeys == 0) { - if (!(subkeys = TALLOC_ZERO_P(ctr, REGSUBKEY_CTR)) ) { + if (!(subkeys = TALLOC_ZERO_P(ctx, REGSUBKEY_CTR)) ) { DEBUG(0,("regdb_store_keys: talloc() failure!\n")); goto cancel; } @@ -595,7 +595,7 @@ bool regdb_store_keys(const char *key, REGSUBKEY_CTR *ctr) if (!path) { goto cancel; } - if (!(subkeys = TALLOC_ZERO_P(ctr, REGSUBKEY_CTR)) ) { + if (!(subkeys = TALLOC_ZERO_P(ctx, REGSUBKEY_CTR)) ) { DEBUG(0,("regdb_store_keys: talloc() failure!\n")); goto cancel; } @@ -626,8 +626,6 @@ cancel: } fail: - TALLOC_FREE(old_subkeys); - TALLOC_FREE(subkeys); TALLOC_FREE(ctx); return false; -- cgit