From f810a57590fa84f6684300516e1d160cb3109082 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bernon?= Date: Fri, 18 Nov 2022 18:37:44 +0100 Subject: [PATCH] rpcss: Use I_Rpc(Free|Allocate) in MIDL_user_(allocate|free). In ept_map, rpcss uses TowerConstruct to allocate tower array elements. The array is later released by the generated stub code, and each element is ultimately freed using MIDL_user_free. TowerConstruct always allocate memory using I_RpcAllocate, we must use I_RpcFree to free it. --- programs/rpcss/irotp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/rpcss/irotp.c b/programs/rpcss/irotp.c index daf48daf0a7..357a7f84cd9 100644 --- a/programs/rpcss/irotp.c +++ b/programs/rpcss/irotp.c @@ -368,10 +368,10 @@ void __RPC_USER IrotContextHandle_rundown(IrotContextHandle ctxt_handle) void * __RPC_USER MIDL_user_allocate(SIZE_T size) { - return malloc(size); + return I_RpcAllocate(size); } void __RPC_USER MIDL_user_free(void * p) { - free(p); + I_RpcFree(p); }