]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ntlm_auth: Fix Coverity ID 240750 Resource leak
authorVolker Lendecke <vl@samba.org>
Thu, 14 Nov 2024 20:04:02 +0000 (21:04 +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 dbce3ed4fdf8b68576f10fabe1244fc9ff6d257f..1a57f7726f2cf22e6cdf5b09b153bcd4b7ed1a63 100644 (file)
@@ -513,7 +513,7 @@ static bool test_plaintext(enum ntlm_break break_which)
        uchar lm_key[16];
        static const uchar zeros[8] = { 0, };
        DATA_BLOB chall = data_blob(zeros, sizeof(zeros));
-       char *error_string;
+       char *error_string = NULL;
 
        ZERO_STRUCT(user_session_key);
 
@@ -587,6 +587,7 @@ static bool test_plaintext(enum ntlm_break break_which)
                SAFE_FREE(error_string);
                return break_which == BREAK_NT;
        }
+       SAFE_FREE(error_string);
 
         return break_which != BREAK_NT;
 }