From b17629045f9416342ebeb8e6073a1f0b3e8ee9d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 13 Jan 2023 12:13:07 +0100 Subject: [PATCH] msv1_0: Avoid double free when SpInitLsaModeContext fails. --- dlls/msv1_0/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/msv1_0/main.c b/dlls/msv1_0/main.c index e4890d00a42..a877d974486 100644 --- a/dlls/msv1_0/main.c +++ b/dlls/msv1_0/main.c @@ -862,7 +862,7 @@ static NTSTATUS NTAPI ntlm_SpInitLsaModeContext( LSA_SEC_HANDLE cred_handle, LSA } done: - if (status != SEC_E_OK && status != SEC_I_CONTINUE_NEEDED) + if (status != SEC_E_OK && status != SEC_I_CONTINUE_NEEDED && !ctx_handle && !input) { ntlm_cleanup( ctx ); free( ctx );