From c50503d049bd28a05c7a17e16c996c3ac497a138 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Mon, 5 May 2014 13:58:03 +0400 Subject: [PATCH] scrrun: Fix use-after-free of version info (Valgrind). --- dlls/scrrun/filesystem.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/scrrun/filesystem.c b/dlls/scrrun/filesystem.c index b04637c46a0..b2a1a3560ce 100644 --- a/dlls/scrrun/filesystem.c +++ b/dlls/scrrun/filesystem.c @@ -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));