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

Jeremy Allison jra at samba.org
Fri Feb 13 18:00:55 GMT 2009


The branch, v3-3-test has been updated
       via  aa4a8b4aece5b11ac4c1db87b87ebadc0a362514 (commit)
       via  fa0ac60d985995a6a07aa05b114683f4cbd731c8 (commit)
      from  cc1c764effd07bb124b5b5cf03fb5a4565c8ed36 (commit)

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


- Log -----------------------------------------------------------------
commit aa4a8b4aece5b11ac4c1db87b87ebadc0a362514
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Feb 13 09:58:35 2009 -0800

    Fix Coverity ID 742 (RESOURCE_LEAK)

commit fa0ac60d985995a6a07aa05b114683f4cbd731c8
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Feb 13 09:53:56 2009 -0800

    Fix Coverity ID 744
    
    This was marked as a resource leak. This change makes the code a bit clearer
    that we always free error_string.

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

Summary of changes:
 source/utils/net_rpc_join.c |    9 +++------
 source/utils/ntlm_auth.c    |    2 +-
 2 files changed, 4 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/utils/net_rpc_join.c b/source/utils/net_rpc_join.c
index dfab65c..20f4750 100644
--- a/source/utils/net_rpc_join.c
+++ b/source/utils/net_rpc_join.c
@@ -485,7 +485,6 @@ done:
  **/
 int net_rpc_testjoin(struct net_context *c, int argc, const char **argv)
 {
-	char *domain = smb_xstrdup(c->opt_target_workgroup);
 	NTSTATUS nt_status;
 
 	if (c->display_usage) {
@@ -496,15 +495,13 @@ int net_rpc_testjoin(struct net_context *c, int argc, const char **argv)
 	}
 
 	/* Display success or failure */
-	nt_status = net_rpc_join_ok(c, domain, NULL, NULL);
+	nt_status = net_rpc_join_ok(c, c->opt_target_workgroup, NULL, NULL);
 	if (!NT_STATUS_IS_OK(nt_status)) {
 		fprintf(stderr,"Join to domain '%s' is not valid: %s\n",
-			domain, nt_errstr(nt_status));
-		free(domain);
+			c->opt_target_workgroup, nt_errstr(nt_status));
 		return -1;
 	}
 
-	printf("Join to '%s' is OK\n",domain);
-	free(domain);
+	printf("Join to '%s' is OK\n", c->opt_target_workgroup);
 	return 0;
 }
diff --git a/source/utils/ntlm_auth.c b/source/utils/ntlm_auth.c
index 2c62bd5..8a9ac42 100644
--- a/source/utils/ntlm_auth.c
+++ b/source/utils/ntlm_auth.c
@@ -1816,7 +1816,6 @@ static void manage_ntlm_server_1_request(struct ntlm_auth_state *state,
 
 				x_fprintf(x_stdout, "Authenticated: No\n");
 				x_fprintf(x_stdout, "Authentication-Error: %s\n.\n", error_string);
-				SAFE_FREE(error_string);
 			} else {
 				static char zeros[16];
 				char *hex_lm_key;
@@ -1844,6 +1843,7 @@ static void manage_ntlm_server_1_request(struct ntlm_auth_state *state,
 					TALLOC_FREE(hex_user_session_key);
 				}
 			}
+			SAFE_FREE(error_string);
 		}
 		/* clear out the state */
 		challenge = data_blob_null;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list