openvr: Memory leak in VR_LoadHmdSystemInternal()

The function Path_IsDirectory (pathtools_public.cpp) is leaking memory (at least on Windows).

Fixed changing this code:


	if ( _wstat( wsFixedPath.c_str(), &buf ) == -1 )
	{
		return false;
	}

	return false;
	
	
	return (buf.st_mode & _S_IFDIR) != 0;

to this:


	std::wstring wsFixedPath = UTF8to16( sFixedPath.c_str() );
	
	if (_wstat(wsFixedPath.c_str(), &buf) == 0 && (buf.st_mode & _S_IFDIR)) return true;

	return false;

About this issue

Most upvoted comments

Ok, I was not really up to date. Thought I had to install CMake on a Linux/WSL host. Let me check.