]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ntlm_auth: Fix Coverity ID 240747 Resource leak
authorVolker Lendecke <vl@samba.org>
Thu, 14 Nov 2024 20:00:07 +0000 (21:00 +0100)
committerRalph Boehme <slow@samba.org>
Tue, 19 Nov 2024 18:11:29 +0000 (18:11 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/utils/ntlm_auth_diagnostics.c

index 69034434148a120b7b232d8af18ccdd2892c15bc..b0c5f490f7f09e0bca6d2564e5cb23a0c5bc8d91 100644 (file)
@@ -375,7 +375,7 @@ static bool test_lmv2_ntlmv2_broken(enum ntlm_break break_which)
        uint8_t authoritative = 1;
        uchar user_session_key[16];
        DATA_BLOB chall = get_challenge();
-       char *error_string;
+       char *error_string = NULL;
 
        ZERO_STRUCT(user_session_key);
 
@@ -429,6 +429,8 @@ static bool test_lmv2_ntlmv2_broken(enum ntlm_break break_which)
                return break_which == BREAK_NT;
        }
 
+       SAFE_FREE(error_string);
+
        if (break_which != NO_NT && break_which != BREAK_NT && memcmp(ntlmv2_session_key.data, user_session_key,
                   sizeof(user_session_key)) != 0) {
                DEBUG(1, ("USER (NTLMv2) Session Key does not match expectations!\n"));