Commit 697955c9 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

secur32: Don't allocate context handle in wrapper InitializeSecurityContextA/W…

secur32: Don't allocate context handle in wrapper InitializeSecurityContextA/W if it is the same as the handle passed into the function.
parent 13468346
......@@ -283,7 +283,8 @@ SECURITY_STATUS WINAPI InitializeSecurityContextA(
cred, ctxt, pszTargetName, fContextReq,
Reserved1, TargetDataRep, pInput, Reserved2, phNewContext ? &myCtxt : NULL,
pOutput, pfContextAttr, ptsExpiry);
if ((ret == SEC_E_OK || ret == SEC_I_CONTINUE_NEEDED) && phNewContext)
if ((ret == SEC_E_OK || ret == SEC_I_CONTINUE_NEEDED) &&
phNewContext && phNewContext != phContext)
{
SECURITY_STATUS ret2;
ret2 = SECUR32_makeSecHandle(phNewContext, package, &myCtxt);
......@@ -346,7 +347,8 @@ SECURITY_STATUS WINAPI InitializeSecurityContextW(
cred, ctxt, pszTargetName, fContextReq,
Reserved1, TargetDataRep, pInput, Reserved2, phNewContext ? &myCtxt : NULL,
pOutput, pfContextAttr, ptsExpiry);
if ((ret == SEC_E_OK || ret == SEC_I_CONTINUE_NEEDED) && phNewContext)
if ((ret == SEC_E_OK || ret == SEC_I_CONTINUE_NEEDED) &&
phNewContext && phNewContext != phContext)
{
SECURITY_STATUS ret2;
ret2 = SECUR32_makeSecHandle(phNewContext, package, &myCtxt);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment