On Wed, 2018-05-16 at 21:14 -0500, Zebediah Figura wrote:
+UINT WINAPI MsiGetTargetPathA(MSIHANDLE hinst, const char *folder, char *buf, DWORD *sz) {
- LPWSTR szwFolder;
- awstring path;
- MSIPACKAGE *package;
- const WCHAR *path;
- WCHAR *folderW; UINT r;
- TRACE("%s %p %p\n", debugstr_a(szFolder), szPathBuf, pcchPathBuf);
- TRACE("%s %p %p\n", debugstr_a(folder), buf, sz);
- szwFolder = strdupAtoW(szFolder);
- if (szFolder && !szwFolder)
return ERROR_FUNCTION_FAILED;
- if (!folder)
return ERROR_INVALID_PARAMETER;
- path.unicode = FALSE;
- path.str.a = szPathBuf;
- if (!(folderW = strdupAtoW(folder)))
return ERROR_OUTOFMEMORY;
- r = MSI_GetTargetPath( hInstall, szwFolder, &path, pcchPathBuf );
- package = msihandle2msiinfo(hinst, MSIHANDLETYPE_PACKAGE);
- if (!package)
- {
WCHAR *path = NULL;
MSIHANDLE remote;
- msi_free( szwFolder );
if (!(remote = msi_get_remote(hinst)))
return ERROR_INVALID_HANDLE;
folderW is leaked here. I missed this in the patch for MsiGetPropertyA.