]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ntlm_auth: Fix Coverity ID 240748 Resource leak
authorVolker Lendecke <vl@samba.org>
Thu, 14 Nov 2024 20:02:09 +0000 (21:02 +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 b0c5f490f7f09e0bca6d2564e5cb23a0c5bc8d91..15f927c4d9b6cd5f9a04655c2c9cb845468136d9 100644 (file)
@@ -289,7 +289,7 @@ static bool test_ntlm_in_both(bool lanman_support_expected)
        uint8_t user_session_key[16];
        uint8_t nt_hash[16];
        DATA_BLOB chall = get_challenge();
-       char *error_string;
+       char *error_string = NULL;
 
        ZERO_STRUCT(lm_key);
        ZERO_STRUCT(user_session_key);
@@ -323,6 +323,7 @@ static bool test_ntlm_in_both(bool lanman_support_expected)
                SAFE_FREE(error_string);
                return False;
        }
+       SAFE_FREE(error_string);
 
        /* If we are told the DC is Samba4, expect an LM key of zeros */
        if (!lanman_support_expected) {