{
wStream* s;
UCHAR *buffer = NULL;
+ BOOL bResult = FALSE;
s = rdp_message_channel_pdu_init(context->rdp);
buffer = (UCHAR *)malloc(payloadLength);
if (NULL == buffer)
{
+ Stream_Release(s);
return FALSE;
}
BCryptGenRandom(NULL, buffer, payloadLength, 0L);
Stream_Write(s, buffer, payloadLength);
- return rdp_send_message_channel_pdu(context->rdp, s, SEC_AUTODETECT_REQ);
+ bResult = rdp_send_message_channel_pdu(context->rdp, s, SEC_AUTODETECT_REQ);
+ if (!bResult)
+ {
+ Stream_Release(s);
+ }
+
+ return bResult;
}
static BOOL autodetect_send_bandwidth_measure_stop(rdpContext* context, UINT16 payloadLength, UINT16 sequenceNumber, UINT16 requestType)
{
wStream* s;
UCHAR *buffer = NULL;
+ BOOL bResult = FALSE;
s = rdp_message_channel_pdu_init(context->rdp);
buffer = malloc(payloadLength);
if (NULL == buffer)
{
+ Stream_Release(s);
return FALSE;
}
}
}
- return rdp_send_message_channel_pdu(context->rdp, s, SEC_AUTODETECT_REQ);
+ bResult = rdp_send_message_channel_pdu(context->rdp, s, SEC_AUTODETECT_REQ);
+ if (!bResult)
+ {
+ Stream_Release(s);
+ }
+
+ return bResult;
}
static BOOL autodetect_send_continuous_bandwidth_measure_stop(rdpContext* context, UINT16 sequenceNumber)