diff --git a/dlls/ole32/rpc.c b/dlls/ole32/rpc.c index 8ac5d2d3e50..35971e0e2bc 100644 --- a/dlls/ole32/rpc.c +++ b/dlls/ole32/rpc.c @@ -539,7 +539,10 @@ static HRESULT WINAPI ServerRpcChannelBuffer_GetBuffer(LPRPCCHANNELBUFFER iface, if (msg->Buffer) status = RPC_S_OK; else - status = ERROR_OUTOFMEMORY; + { + HeapFree(GetProcessHeap(), 0, channel_hook_data); + return E_OUTOFMEMORY; + } } else status = I_RpcGetBuffer(msg);