scrrun: Fix use-after-free of version info (Valgrind).

This commit is contained in:
Nikolay Sivov 2014-05-05 13:58:03 +04:00 committed by Alexandre Julliard
parent a596cbb847
commit c50503d049
1 changed files with 5 additions and 1 deletions

View File

@ -3657,11 +3657,15 @@ static HRESULT WINAPI filesys_GetFileVersion(IFileSystem3 *iface, BSTR name, BST
}
ret = VerQueryValueW(ptr, rootW, (void**)&info, &len);
heap_free(ptr);
if (!ret)
{
heap_free(ptr);
return HRESULT_FROM_WIN32(GetLastError());
}
get_versionstring(info, ver);
heap_free(ptr);
*version = SysAllocString(ver);
TRACE("version=%s\n", debugstr_w(ver));