From ddf59f50f77448f7ba2d240e93eb3e8ed535c1ea Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Mon, 26 Nov 2007 22:50:48 +0000 Subject: [PATCH] ole32: Clean up properly in ClientRpcChannelBuffer_SendReceive in the case where PostMessageW fails. --- dlls/ole32/rpc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dlls/ole32/rpc.c b/dlls/ole32/rpc.c index d4e6bfdbcaf..40330d4e255 100644 --- a/dlls/ole32/rpc.c +++ b/dlls/ole32/rpc.c @@ -796,6 +796,14 @@ static HRESULT WINAPI ClientRpcChannelBuffer_SendReceive(LPRPCCHANNELBUFFER ifac (LPARAM)&message_state->params)) { ERR("PostMessage failed with error %u\n", GetLastError()); + + IRpcStubBuffer_Release(message_state->params.stub); + message_state->params.stub = NULL; + IRpcChannelBuffer_Release(message_state->params.chan); + message_state->params.chan = NULL; + /* Note: message_state->params.iface doesn't have a reference and + * so doesn't need to be released */ + hr = HRESULT_FROM_WIN32(GetLastError()); } }