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:
parent
caa9f89a18
commit
f2b1a1106b
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue