From e64825e6208e1b31ccc19a28561858db28694bae Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 17 Mar 2008 00:43:56 +0100 Subject: registry: don't leak memory on transaction fail in regdb_store_keys(). Michael (This used to be commit 9315de404812d89dddcec6ac4ae17c34f5012746) --- source3/registry/reg_backend_db.c | 4 ++-- 1 file 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; -- cgit