ReHIPS forum

English Subforum => Developers' Blog => Topic started by: fixer on December 06, 2018, 10:38:39 AM

Title: [BUG] WTSFreeMemoryExA and memory leak
Post by: fixer on December 06, 2018, 10:38:39 AM
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.