Fix cleanup of RDPEI server-side channel

This commit is contained in:
Hardening 2014-12-10 16:47:15 +01:00
parent 53686e414a
commit 7b6c14bdcf

View File

@ -126,6 +126,7 @@ void rdpei_server_context_reset(RdpeiServerContext *context)
{ {
RdpeiServerPrivate *priv = context->priv; RdpeiServerPrivate *priv = context->priv;
priv->channelHandle = INVALID_HANDLE_VALUE;
priv->expectedBytes = RDPINPUT_HEADER_LENGTH; priv->expectedBytes = RDPINPUT_HEADER_LENGTH;
priv->waitingHeaders = TRUE; priv->waitingHeaders = TRUE;
priv->automataState = STATE_INITIAL; priv->automataState = STATE_INITIAL;
@ -134,8 +135,11 @@ void rdpei_server_context_reset(RdpeiServerContext *context)
void rdpei_server_context_free(RdpeiServerContext* context) void rdpei_server_context_free(RdpeiServerContext* context)
{ {
Stream_Free(context->priv->inputStream, TRUE); RdpeiServerPrivate *priv = context->priv;
free(context->priv); if (priv->channelHandle != INVALID_HANDLE_VALUE)
WTSVirtualChannelClose(priv->channelHandle);
Stream_Free(priv->inputStream, TRUE);
free(priv);
free(context); free(context);
} }