ole32: Fix memory leaks caused by not calling the channel hook function when extension_size is zero.

Instead free the allocated memory outside of the channel hook function.
This commit is contained in:
Rob Shearman 2008-01-07 17:15:17 +00:00 committed by Alexandre Julliard
parent caa9f89a18
commit f2b1a1106b
1 changed files with 4 additions and 4 deletions

View File

@ -248,8 +248,6 @@ static unsigned char * ChannelHooks_ClientFillBuffer(SChannelHookCallInfo *info,
LeaveCriticalSection(&csChannelHook);
HeapFree(GetProcessHeap(), 0, data);
return buffer;
}
@ -370,8 +368,6 @@ static unsigned char * ChannelHooks_ServerFillBuffer(SChannelHookCallInfo *info,
LeaveCriticalSection(&csChannelHook);
HeapFree(GetProcessHeap(), 0, data);
return buffer;
}
@ -563,6 +559,8 @@ static HRESULT WINAPI ServerRpcChannelBuffer_GetBuffer(LPRPCCHANNELBUFFER iface,
}
}
HeapFree(GetProcessHeap(), 0, channel_hook_data);
/* store the prefixed data length so that we can restore the real buffer
* later */
message_state->prefix_data_len = (char *)msg->Buffer - (char *)orpcthat;
@ -751,6 +749,8 @@ static HRESULT WINAPI ClientRpcChannelBuffer_GetBuffer(LPRPCCHANNELBUFFER iface,
msg->BufferLength -= message_state->prefix_data_len;
}
HeapFree(GetProcessHeap(), 0, channel_hook_data);
TRACE("-- %ld\n", status);
return HRESULT_FROM_WIN32(status);