svn commit: samba r20209 - in branches/SAMBA_3_0/source/registry: .

vlendec at samba.org vlendec at samba.org
Sat Dec 16 09:33:17 GMT 2006


Author: vlendec
Date: 2006-12-16 09:33:17 +0000 (Sat, 16 Dec 2006)
New Revision: 20209

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20209

Log:
Fix two memleaks
Modified:
   branches/SAMBA_3_0/source/registry/reg_eventlog.c


Changeset:
Modified: branches/SAMBA_3_0/source/registry/reg_eventlog.c
===================================================================
--- branches/SAMBA_3_0/source/registry/reg_eventlog.c	2006-12-16 05:02:21 UTC (rev 20208)
+++ branches/SAMBA_3_0/source/registry/reg_eventlog.c	2006-12-16 09:33:17 UTC (rev 20209)
@@ -48,8 +48,10 @@
 		}
 		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 @@
 		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 @@
 			 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" ) );



More information about the samba-cvs mailing list