s3: Remove some unnecessary if-statements
authorVolker Lendecke <vl@samba.org>
Mon, 13 Sep 2010 22:02:01 +0000 (00:02 +0200)
committerVolker Lendecke <vl@samba.org>
Tue, 14 Sep 2010 05:02:44 +0000 (22:02 -0700)
source3/utils/ntlm_auth.c

index 0fa0c297df2a0f401a8d97dc30deb3b6e5148de5..241dc56e601d657faba8c353a5b1b069127e18fc 100644 (file)
@@ -856,8 +856,7 @@ static void manage_squid_ntlmssp_request(struct ntlm_auth_state *state,
        }
 
        if (strncmp(buf, "YR", 2) == 0) {
-               if (state->ntlmssp_state)
-                       TALLOC_FREE(state->ntlmssp_state);
+               TALLOC_FREE(state->ntlmssp_state);
                state->svr_state = SERVER_INITIAL;
        } else if (strncmp(buf, "KK", 2) == 0) {
                /* No special preprocessing required */
@@ -1012,8 +1011,7 @@ static void manage_client_ntlmssp_request(struct ntlm_auth_state *state,
        }
 
        if (strncmp(buf, "YR", 2) == 0) {
-               if (state->ntlmssp_state)
-                       TALLOC_FREE(state->ntlmssp_state);
+               TALLOC_FREE(state->ntlmssp_state);
                state->cli_state = CLIENT_INITIAL;
        } else if (strncmp(buf, "TT", 2) == 0) {
                /* No special preprocessing required */
@@ -1104,14 +1102,12 @@ static void manage_client_ntlmssp_request(struct ntlm_auth_state *state,
 
                DEBUG(10, ("NTLMSSP OK!\n"));
                state->cli_state = CLIENT_FINISHED;
-               if (state->ntlmssp_state)
-                       TALLOC_FREE(state->ntlmssp_state);
+               TALLOC_FREE(state->ntlmssp_state);
        } else {
                x_fprintf(x_stdout, "BH %s\n", nt_errstr(nt_status));
                DEBUG(0, ("NTLMSSP BH: %s\n", nt_errstr(nt_status)));
                state->cli_state = CLIENT_ERROR;
-               if (state->ntlmssp_state)
-                       TALLOC_FREE(state->ntlmssp_state);
+               TALLOC_FREE(state->ntlmssp_state);
        }
 
        data_blob_free(&request);
@@ -1225,8 +1221,7 @@ static void manage_gss_spnego_request(struct ntlm_auth_state *state,
        }
 
        if (strncmp(buf, "YR", 2) == 0) {
-               if (ntlmssp_state)
-                       TALLOC_FREE(ntlmssp_state);
+               TALLOC_FREE(ntlmssp_state);
        } else if (strncmp(buf, "KK", 2) == 0) {
                ;
        } else {