core: unify function behaviour of WTSVirtualChannelQuery

With all calls when WTSVirtualChannelQuery returns FALSE that means that
no ppBuffer was allocated, that was not the case with class=WTSVirtualChannelReady.
Most callers were not aware of that, leading to leaks for example when the channel is
not available client-side, the patch changes that so that you have to call call WTSFreeMemory
only if WTSVirtualChannelQuery returned TRUE.
This commit is contained in:
David Fort 2022-12-23 16:16:58 +01:00 committed by Martin Fleisz
parent bee2873b52
commit 73495a1576

View File

@ -1693,9 +1693,9 @@ BOOL WINAPI FreeRDP_WTSVirtualChannelQuery(HANDLE hChannelHandle, WTS_VIRTUAL_CL
break;
default:
bval = FALSE;
status = FALSE;
break;
*ppBuffer = NULL;
*pBytesReturned = 0;
return FALSE;
}
}