[BUG] WTSFreeMemoryExA and memory leak

Started by fixer, December 06, 2018, 10:38:39 AM

Previous topic - Next topic


WTSFreeMemoryExA API function is supposed to free allocated memory. And one of the parameters it receives is WTSTypeClass, it indicates the types of structures this function should free. It can be WTSTypeProcessInfoLevel0, WTSTypeProcessInfoLevel1 or WTSTypeSessionInfoLevel1. But sanity checking inside this function accepts only the first two and returns ERROR_INVALID_PARAMETER on the third one without freeing anything. And hence it leads to memory leaks.

Any solutions? Looks like WTSFreeMemoryExW doesn't have this bug.

This issue was found several months ago, it wasn't fixed then. I haven't checked it since, but I suspect it to remain broken for many years to come.