rpcrt4: Make sure we don't try to free a pointer twice.

This commit is contained in:
Alexandre Julliard 2011-06-20 14:07:59 +02:00
parent 809810eb28
commit 781ff545cf
1 changed files with 7 additions and 7 deletions

View File

@ -1241,18 +1241,18 @@ static LONG_PTR *stub_do_args(MIDL_STUB_MESSAGE *pStubMsg,
else else
call_freer(pStubMsg, *(unsigned char **)pArg, pTypeFormat); call_freer(pStubMsg, *(unsigned char **)pArg, pTypeFormat);
} }
else if (pParam->param_attributes.ServerAllocSize)
if (pParam->param_attributes.IsOut && {
HeapFree(GetProcessHeap(), 0, *(void **)pArg);
}
else if (pParam->param_attributes.IsOut &&
!pParam->param_attributes.IsIn && !pParam->param_attributes.IsIn &&
!pParam->param_attributes.IsByValue && !pParam->param_attributes.IsByValue)
!pParam->param_attributes.ServerAllocSize)
{ {
if (*pTypeFormat != RPC_FC_BIND_CONTEXT) if (*pTypeFormat != RPC_FC_BIND_CONTEXT)
pStubMsg->pfnFree(*(void **)pArg); pStubMsg->pfnFree(*(void **)pArg);
} }
if (pParam->param_attributes.ServerAllocSize)
HeapFree(GetProcessHeap(), 0, *(void **)pArg);
break; break;
case STUBLESS_INITOUT: case STUBLESS_INITOUT:
if (!pParam->param_attributes.IsIn && if (!pParam->param_attributes.IsIn &&