From 4467fd6d232cd715cd63b1ebf74c6013e19563b1 Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Mon, 16 Oct 2017 10:08:49 +0200 Subject: [PATCH] secur32: Don't allocate a context handle in AcceptSecurityContext if new and passed in context are the same. Signed-off-by: Hans Leidekker Signed-off-by: Alexandre Julliard --- dlls/secur32/wrapper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/secur32/wrapper.c b/dlls/secur32/wrapper.c index 06a36745893..dba675422d0 100644 --- a/dlls/secur32/wrapper.c +++ b/dlls/secur32/wrapper.c @@ -399,7 +399,8 @@ SECURITY_STATUS WINAPI AcceptSecurityContext( ret = package->provider->fnTableW.AcceptSecurityContext( cred, phContext ? &myCtxt : NULL, pInput, fContextReq, TargetDataRep, &myCtxt, pOutput, pfContextAttr, ptsExpiry); - if (ret == SEC_E_OK || ret == SEC_I_CONTINUE_NEEDED) + if ((ret == SEC_E_OK || ret == SEC_I_CONTINUE_NEEDED) && + phNewContext && phNewContext != phContext) { SECURITY_STATUS ret2; ret2 = SECUR32_makeSecHandle(phNewContext, package, &myCtxt);