Module: wine Branch: master Commit: 3a143c0938f7937b82e50d751feea55ec888933a URL: https://gitlab.winehq.org/wine/wine/-/commit/3a143c0938f7937b82e50d751feea55...
Author: Rémi Bernon rbernon@codeweavers.com Date: Thu Jan 12 22:59:51 2023 +0100
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.
---
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 d416da13465..e4890d00a42 100644 --- a/dlls/msv1_0/main.c +++ b/dlls/msv1_0/main.c @@ -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 );