ole32: Return if out of memory (Coverity) (try 2)

André Hentschel nerv at dawncrow.de
Wed Sep 28 12:58:57 CDT 2011


try 2: didn't looked into the ChannelHooks_ServerGetSize function as i didn't expect a getsize to allocate something, my fault

my first try with coverity
msg->Buffer otherwise gets used after that
CID 1528
---
 dlls/ole32/rpc.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/dlls/ole32/rpc.c b/dlls/ole32/rpc.c
index 8ac5d2d..35971e0 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);
-- 

Best Regards, André Hentschel



More information about the wine-patches mailing list