[core] fix resource leaks

This commit is contained in:
Armin Novak
2025-03-05 11:04:36 +01:00
parent d765de8484
commit e9a084ea05
2 changed files with 3 additions and 3 deletions

View File

@@ -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))

View File

@@ -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;
}