The branch, v3-2-test has been updated
       via  eee6c3cd63c08f999c400d864dd7f7de68c03b85 (commit)
       via  b03d45e6783e2706bd5d9c98a88ac07933e3adeb (commit)
      from  6c52b5cb48d93934fe472eb57511dd05a89eb523 (commit)

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


- Log -----------------------------------------------------------------
commit eee6c3cd63c08f999c400d864dd7f7de68c03b85
Author: Volker Lendecke <[email protected]>
Date:   Fri Feb 13 09:58:48 2009 -0800

    Fix Coverity ID 742 (RESOURCE_LEAK)

commit b03d45e6783e2706bd5d9c98a88ac07933e3adeb
Author: Volker Lendecke <[email protected]>
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 0e8f47b..4d5affa 100644
--- a/source/utils/net_rpc_join.c
+++ b/source/utils/net_rpc_join.c
@@ -481,19 +481,16 @@ done:
  **/
 int net_rpc_testjoin(int argc, const char **argv) 
 {
-       char *domain = smb_xstrdup(opt_target_workgroup);
        NTSTATUS nt_status;
 
        /* Display success or failure */
-       nt_status = net_rpc_join_ok(domain, NULL, NULL);
+       nt_status = net_rpc_join_ok(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);
+                       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",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

Reply via email to