tsg: rpc_send_enqueue_pdu always free buffer
rpc_send_enqueue_pdu returns -1 on error but the type of error isn't distinguishable. Therefore make sure that the buffer gets always freed. The only exception to this is when the pdu was already queued. Then the dequeuing function should take care of freeing the buffer when processing the pdu.
This commit is contained in:
parent
96ae2df5a4
commit
5066a5e455
@ -354,7 +354,10 @@ int rpc_send_enqueue_pdu(rdpRpc* rpc, BYTE* buffer, UINT32 length)
|
||||
pdu = (RPC_PDU*) malloc(sizeof(RPC_PDU));
|
||||
|
||||
if (!pdu)
|
||||
{
|
||||
free(buffer);
|
||||
return -1;
|
||||
}
|
||||
|
||||
pdu->s = Stream_New(buffer, length);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user