From 5ee2748106e426bd8789a934dbecac0a3869f9e8 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 16 Dec 2006 09:33:17 +0000 Subject: r20209: Fix two memleaks (This used to be commit 92bc870768a2ff839b3b10897a4f09a3ece92704) --- source3/registry/reg_eventlog.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'source3') diff --git a/source3/registry/reg_eventlog.c b/source3/registry/reg_eventlog.c index ea2b274f88..90d9a24437 100644 --- a/source3/registry/reg_eventlog.c +++ b/source3/registry/reg_eventlog.c @@ -48,8 +48,10 @@ BOOL eventlog_init_keys( void ) } regdb_fetch_keys( KEY_EVENTLOG, subkeys ); regsubkey_ctr_addkey( subkeys, *elogs ); - if ( !regdb_store_keys( KEY_EVENTLOG, subkeys ) ) + if ( !regdb_store_keys( KEY_EVENTLOG, subkeys ) ) { + TALLOC_FREE(subkeys); return False; + } TALLOC_FREE( subkeys ); /* add in the key of form KEY_EVENTLOG/Application */ @@ -70,8 +72,10 @@ BOOL eventlog_init_keys( void ) regdb_fetch_keys( evtlogpath, subkeys ); regsubkey_ctr_addkey( subkeys, *elogs ); - if ( !regdb_store_keys( evtlogpath, subkeys ) ) + if ( !regdb_store_keys( evtlogpath, subkeys ) ) { + TALLOC_FREE(subkeys); return False; + } TALLOC_FREE( subkeys ); /* now add the values to the KEY_EVENTLOG/Application form key */ @@ -287,8 +291,7 @@ BOOL eventlog_add_source( const char *eventlog, const char *sourcename, sourcename ) ); } TALLOC_FREE( values ); - if ( wrklist ) - TALLOC_FREE( wrklist ); /* */ + TALLOC_FREE( wrklist ); /* */ if ( !( subkeys = TALLOC_ZERO_P( NULL, REGSUBKEY_CTR ) ) ) { DEBUG( 0, ( "talloc() failure!\n" ) ); -- cgit