From: Volker Lendecke Date: Thu, 14 Nov 2024 20:00:07 +0000 (+0100) Subject: ntlm_auth: Fix Coverity ID 240747 Resource leak X-Git-Tag: tdb-1.4.13~502 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2e111267acbba8afc9aafda288fce90034d95e98;p=thirdparty%2Fsamba.git ntlm_auth: Fix Coverity ID 240747 Resource leak Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- diff --git a/source3/utils/ntlm_auth_diagnostics.c b/source3/utils/ntlm_auth_diagnostics.c index 69034434148..b0c5f490f7f 100644 --- a/source3/utils/ntlm_auth_diagnostics.c +++ b/source3/utils/ntlm_auth_diagnostics.c @@ -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"));