mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 08:54:38 +09:00
[channels,rdpei] properly clean up server channel
Fix a leak in rdpei_server_context_free and some checks in rdpei_server_context_new
This commit is contained in:
@@ -296,7 +296,7 @@ RdpeiServerContext* rdpei_server_context_new(HANDLE vcm)
|
||||
goto fail;
|
||||
|
||||
ret->priv->outputStream = Stream_New(NULL, 200);
|
||||
if (!ret->priv->inputStream)
|
||||
if (!ret->priv->outputStream)
|
||||
goto fail;
|
||||
|
||||
ret->vcm = vcm;
|
||||
@@ -350,16 +350,15 @@ void rdpei_server_context_reset(RdpeiServerContext* context)
|
||||
|
||||
void rdpei_server_context_free(RdpeiServerContext* context)
|
||||
{
|
||||
RdpeiServerPrivate* priv = NULL;
|
||||
|
||||
if (!context)
|
||||
return;
|
||||
priv = context->priv;
|
||||
RdpeiServerPrivate* priv = context->priv;
|
||||
if (priv)
|
||||
{
|
||||
if (priv->channelHandle && priv->channelHandle != INVALID_HANDLE_VALUE)
|
||||
(void)WTSVirtualChannelClose(priv->channelHandle);
|
||||
Stream_Free(priv->inputStream, TRUE);
|
||||
Stream_Free(priv->outputStream, TRUE);
|
||||
}
|
||||
free(priv);
|
||||
free(context);
|
||||
|
||||
Reference in New Issue
Block a user