[PATCH 3/3] rpcrt4: Don't free server-allocated memory with the MustFree flag.

Huw Davies huw at codeweavers.com
Mon Oct 15 04:18:52 CDT 2018


On Sat, Oct 13, 2018 at 05:46:44PM -0500, Zebediah Figura wrote:
> Since it will have already been freed in the MUSTFREE pass.
> 
> Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
> ---
>  dlls/rpcrt4/ndr_stubless.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/dlls/rpcrt4/ndr_stubless.c b/dlls/rpcrt4/ndr_stubless.c
> index c2f260c..768bdc1 100644
> --- a/dlls/rpcrt4/ndr_stubless.c
> +++ b/dlls/rpcrt4/ndr_stubless.c
> @@ -1215,7 +1215,7 @@ static LONG_PTR *stub_do_args(MIDL_STUB_MESSAGE *pStubMsg,
>              }
>              break;
>          case STUBLESS_FREE:
> -            if (params[i].attr.ServerAllocSize)
> +            if (params[i].attr.ServerAllocSize && !params[i].attr.MustFree)
>              {
>                  HeapFree(GetProcessHeap(), 0, *(void **)pArg);
>              }

Do we need to free in the IsSimpleRef case (like the else block
below)?  In this case the freer won't see the top-level ptr, though
it may not be an issue with ServerAllocSize.

Huw.



More information about the wine-devel mailing list