mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[core] fix resource leaks
This commit is contained in:
@@ -211,7 +211,6 @@ BOOL rdp_send_server_control_granted_pdu(rdpRdp* rdp)
|
||||
|
||||
BOOL rdp_send_client_control_pdu(rdpRdp* rdp, UINT16 action)
|
||||
{
|
||||
wStream* s = rdp_data_pdu_init(rdp);
|
||||
UINT16 GrantId = 0;
|
||||
UINT16 ControlId = 0;
|
||||
|
||||
@@ -227,6 +226,7 @@ BOOL rdp_send_client_control_pdu(rdpRdp* rdp, UINT16 action)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
wStream* s = rdp_data_pdu_init(rdp);
|
||||
if (!s)
|
||||
return FALSE;
|
||||
if (!rdp_write_client_control_pdu(s, action, GrantId, ControlId))
|
||||
|
||||
@@ -308,7 +308,6 @@ static BOOL autodetect_send_bandwidth_measure_results(rdpAutoDetect* autodetect,
|
||||
UINT16 responseType, UINT16 sequenceNumber)
|
||||
{
|
||||
BOOL success = TRUE;
|
||||
wStream* s = NULL;
|
||||
UINT64 timeDelta = GetTickCount64();
|
||||
|
||||
WINPR_ASSERT(autodetect);
|
||||
@@ -327,7 +326,7 @@ static BOOL autodetect_send_bandwidth_measure_results(rdpAutoDetect* autodetect,
|
||||
timeDelta -= autodetect->bandwidthMeasureStartTime;
|
||||
|
||||
/* Send the result PDU to the server */
|
||||
s = rdp_message_channel_pdu_init(autodetect->context->rdp);
|
||||
wStream* s = rdp_message_channel_pdu_init(autodetect->context->rdp);
|
||||
|
||||
if (!s)
|
||||
return FALSE;
|
||||
@@ -350,6 +349,7 @@ static BOOL autodetect_send_bandwidth_measure_results(rdpAutoDetect* autodetect,
|
||||
if (!success)
|
||||
{
|
||||
WLog_Print(autodetect->log, WLOG_ERROR, "ClientBandwidthMeasureResult failed");
|
||||
Stream_Release(s);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user