summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-12-16 09:33:17 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:16:32 -0500
commit5ee2748106e426bd8789a934dbecac0a3869f9e8 (patch)
tree68266130c87702ed42cdccdeb5623897f6364723
parenta179d2f495e8dfb9ad30c2b7cec5349cb4e001af (diff)
downloadsamba-5ee2748106e426bd8789a934dbecac0a3869f9e8.tar.gz
samba-5ee2748106e426bd8789a934dbecac0a3869f9e8.tar.bz2
samba-5ee2748106e426bd8789a934dbecac0a3869f9e8.zip
r20209: Fix two memleaks
(This used to be commit 92bc870768a2ff839b3b10897a4f09a3ece92704)
-rw-r--r--source3/registry/reg_eventlog.c11
1 files changed, 7 insertions, 4 deletions
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" ) );