summaryrefslogtreecommitdiff
path: root/source3/registry
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-03-17 00:43:56 +0100
committerMichael Adam <obnox@samba.org>2008-03-17 08:22:33 +0100
commite64825e6208e1b31ccc19a28561858db28694bae (patch)
tree067209cd743239aa74ddae7bdfe8fcf7de64df04 /source3/registry
parentba8607acc1d5d5a96363a2eada8b17ca50c6e5f8 (diff)
downloadsamba-e64825e6208e1b31ccc19a28561858db28694bae.tar.gz
samba-e64825e6208e1b31ccc19a28561858db28694bae.tar.bz2
samba-e64825e6208e1b31ccc19a28561858db28694bae.zip
registry: don't leak memory on transaction fail in regdb_store_keys().
Michael (This used to be commit 9315de404812d89dddcec6ac4ae17c34f5012746)
Diffstat (limited to 'source3/registry')
-rw-r--r--source3/registry/reg_backend_db.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c
index 13458fe459..787ca76f89 100644
--- a/source3/registry/reg_backend_db.c
+++ b/source3/registry/reg_backend_db.c
@@ -493,6 +493,8 @@ bool regdb_store_keys(const char *key, REGSUBKEY_CTR *ctr)
}
}
+ TALLOC_FREE(old_subkeys);
+
if (regdb->transaction_start(regdb) == -1) {
DEBUG(0, ("regdb_store_keys: transaction_start failed\n"));
return false;
@@ -502,8 +504,6 @@ bool regdb_store_keys(const char *key, REGSUBKEY_CTR *ctr)
* Re-fetch the old keys inside the transaction
*/
- TALLOC_FREE(old_subkeys);
-
if (!(old_subkeys = TALLOC_ZERO_P(ctr, REGSUBKEY_CTR))) {
DEBUG(0,("regdb_store_keys: talloc() failure!\n"));
goto fail;