msv1_0: Avoid double free when SpAcceptLsaModeContext fails.

And a previously created context is passed, which may later be destroyed
on its own, causing a double free.
This commit is contained in:
Rémi Bernon 2023-01-12 22:59:51 +01:00 committed by Alexandre Julliard
parent f221465a3c
commit 3a143c0938

View file

@ -1078,7 +1078,7 @@ static NTSTATUS NTAPI ntlm_SpAcceptLsaModeContext( LSA_SEC_HANDLE cred_handle, L
}
done:
if (status != SEC_E_OK && status != SEC_I_CONTINUE_NEEDED)
if (status != SEC_E_OK && status != SEC_I_CONTINUE_NEEDED && !ctx_handle)
{
ntlm_cleanup( ctx );
free( ctx );