rpcrt4: Free server side arguments with MustFree flag first so other arguments may be used to determine its size.
This also fixes a leak when both MustFree and ServerAllocSize flags are specified.
This commit is contained in:
parent
98aa8528d5
commit
614afcefa3
|
@ -1161,12 +1161,14 @@ static LONG_PTR *stub_do_args(MIDL_STUB_MESSAGE *pStubMsg,
|
|||
if (params[i].attr.IsOut || params[i].attr.IsReturn)
|
||||
call_marshaller(pStubMsg, pArg, ¶ms[i]);
|
||||
break;
|
||||
case STUBLESS_FREE:
|
||||
case STUBLESS_MUSTFREE:
|
||||
if (params[i].attr.MustFree)
|
||||
{
|
||||
call_freer(pStubMsg, pArg, ¶ms[i]);
|
||||
}
|
||||
else if (params[i].attr.ServerAllocSize)
|
||||
break;
|
||||
case STUBLESS_FREE:
|
||||
if (params[i].attr.ServerAllocSize)
|
||||
{
|
||||
HeapFree(GetProcessHeap(), 0, *(void **)pArg);
|
||||
}
|
||||
|
@ -1455,6 +1457,7 @@ LONG WINAPI NdrStubCall2(
|
|||
case STUBLESS_INITOUT:
|
||||
case STUBLESS_CALCSIZE:
|
||||
case STUBLESS_MARSHAL:
|
||||
case STUBLESS_MUSTFREE:
|
||||
case STUBLESS_FREE:
|
||||
retval_ptr = stub_do_args(&stubMsg, pFormat, phase, number_of_params);
|
||||
break;
|
||||
|
|
|
@ -234,6 +234,7 @@ enum stubless_phase
|
|||
STUBLESS_CALCSIZE,
|
||||
STUBLESS_GETBUFFER,
|
||||
STUBLESS_MARSHAL,
|
||||
STUBLESS_MUSTFREE,
|
||||
STUBLESS_FREE
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue