From d76717fe150846cb90af58ac1c6e007aeced3df1 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: Mon, 15 Oct 2007 07:24:44 +0400 Subject: Correctly free memory in regfio paths (This used to be commit 97f9a90b823887e808cca96eca7a041f121e6111) --- source3/utils/profiles.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source3/utils/profiles.c') diff --git a/source3/utils/profiles.c b/source3/utils/profiles.c index 7c7b91adb1..921af56657 100644 --- a/source3/utils/profiles.c +++ b/source3/utils/profiles.c @@ -138,6 +138,7 @@ static BOOL copy_registry_tree( REGF_FILE *infile, REGF_NK_REC *nk, } if ( !(values = TALLOC_ZERO_P( subkeys, REGVAL_CTR )) ) { + TALLOC_FREE( subkeys ); DEBUG(0,("copy_registry_tree: talloc() failure!\n")); return False; } @@ -163,8 +164,10 @@ static BOOL copy_registry_tree( REGF_FILE *infile, REGF_NK_REC *nk, nk->subkey_index = 0; while ( (subkey = regfio_fetch_subkey( infile, nk )) ) { - if ( !copy_registry_tree( infile, subkey, key, outfile, path ) ) + if ( !copy_registry_tree( infile, subkey, key, outfile, path ) ) { + TALLOC_FREE( subkeys ); return False; + } } /* values is a talloc()'d child of subkeys here so just throw it all away */ -- cgit