[SCM] Samba Shared Repository - branch v3-3-test updated - release-3-2-0pre2-2875-g675bb53

Volker Lendecke vlendec at samba.org
Tue Jun 17 14:08:02 GMT 2008


The branch, v3-3-test has been updated
       via  675bb53398ba29c53d2dcf3c7122cf4770c2f938 (commit)
      from  5b12d8aa510689114e5413be5afe6aeb6ec2d9db (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test


- Log -----------------------------------------------------------------
commit 675bb53398ba29c53d2dcf3c7122cf4770c2f938
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Jun 17 16:06:42 2008 +0200

    Fix a memleak in svcctl_init_keys()

-----------------------------------------------------------------------

Summary of changes:
 source/services/services_db.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/services/services_db.c b/source/services/services_db.c
index 620b036..ae9fe1a 100644
--- a/source/services/services_db.c
+++ b/source/services/services_db.c
@@ -447,15 +447,22 @@ void svcctl_init_keys( void )
 	REGSUBKEY_CTR *subkeys;
 	REGISTRY_KEY *key = NULL;
 	WERROR wresult;
+	struct nt_user_token *token = get_root_nt_token();
+
+	if (token == NULL) {
+		DEBUG(0, ("svcctl_init_keys: get_root_nt_token failed\n"));
+		return;
+	}
 
 	/* bad mojo here if the lookup failed.  Should not happen */
 
 	wresult = regkey_open_internal( NULL, &key, KEY_SERVICES,
-					get_root_nt_token(), REG_KEY_ALL );
+					token, REG_KEY_ALL );
 
 	if ( !W_ERROR_IS_OK(wresult) ) {
 		DEBUG(0,("svcctl_init_keys: key lookup failed! (%s)\n",
 			dos_errstr(wresult)));
+		TALLOC_FREE(token);
 		return;
 	}
 
@@ -464,6 +471,7 @@ void svcctl_init_keys( void )
 	if ( !(subkeys = TALLOC_ZERO_P( key, REGSUBKEY_CTR )) ) {
 		DEBUG(0,("svcctl_init_keys: talloc() failed!\n"));
 		TALLOC_FREE( key );
+		TALLOC_FREE(token);
 		return;
 	}
 
@@ -486,6 +494,7 @@ void svcctl_init_keys( void )
 	}
 
 	TALLOC_FREE( key );
+	TALLOC_FREE(token);
 
 	/* initialize the control hooks */
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list