From 2e111267acbba8afc9aafda288fce90034d95e98 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 14 Nov 2024 21:00:07 +0100 Subject: [PATCH] ntlm_auth: Fix Coverity ID 240747 Resource leak Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- source3/utils/ntlm_auth_diagnostics.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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")); -- 2.47.3