[channels,rdpgfx] use static stream

This commit is contained in:
akallabeth 2024-05-21 12:11:05 +02:00
parent 5ca17aa8f3
commit 5475f3fc24
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5

View File

@ -2077,7 +2077,6 @@ static UINT rdpgfx_recv_pdu(GENERIC_CHANNEL_CALLBACK* callback, wStream* s)
*/
static UINT rdpgfx_on_data_received(IWTSVirtualChannelCallback* pChannelCallback, wStream* data)
{
wStream* s = NULL;
int status = 0;
UINT32 DstSize = 0;
BYTE* pDstData = NULL;
@ -2097,11 +2096,13 @@ static UINT rdpgfx_on_data_received(IWTSVirtualChannelCallback* pChannelCallback
return ERROR_INTERNAL_ERROR;
}
s = Stream_New(pDstData, DstSize);
wStream sbuffer = { 0 };
wStream* s = Stream_StaticConstInit(&sbuffer, pDstData, DstSize);
if (!s)
{
WLog_Print(gfx->log, WLOG_ERROR, "calloc failed!");
free(pDstData);
return CHANNEL_RC_NO_MEMORY;
}
@ -2115,7 +2116,7 @@ static UINT rdpgfx_on_data_received(IWTSVirtualChannelCallback* pChannelCallback
}
}
Stream_Free(s, TRUE);
free(pDstData);
return error;
}