diff --git a/dlls/rpcrt4/ndr_stubless.c b/dlls/rpcrt4/ndr_stubless.c index 033c650d4ac..f5a6babb400 100644 --- a/dlls/rpcrt4/ndr_stubless.c +++ b/dlls/rpcrt4/ndr_stubless.c @@ -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; diff --git a/dlls/rpcrt4/ndr_stubless.h b/dlls/rpcrt4/ndr_stubless.h index 5b0add0d95d..2e7beba2383 100644 --- a/dlls/rpcrt4/ndr_stubless.h +++ b/dlls/rpcrt4/ndr_stubless.h @@ -234,6 +234,7 @@ enum stubless_phase STUBLESS_CALCSIZE, STUBLESS_GETBUFFER, STUBLESS_MARSHAL, + STUBLESS_MUSTFREE, STUBLESS_FREE };