diff --git a/dll/win32/msi/package.c b/dll/win32/msi/package.c index c3bc9dcde62..b42158c6c02 100644 --- a/dll/win32/msi/package.c +++ b/dll/win32/msi/package.c @@ -2375,9 +2375,14 @@ UINT WINAPI MsiGetPropertyA(MSIHANDLE hinst, const char *name, char *buf, DWORD DWORD len; if (!(remote = msi_get_remote(hinst))) + { + heap_free(nameW); return ERROR_INVALID_HANDLE; + } r = remote_GetProperty(remote, nameW, &value, &len); + heap_free(nameW); + if (!r) { /* String might contain embedded nulls. @@ -2395,7 +2400,6 @@ UINT WINAPI MsiGetPropertyA(MSIHANDLE hinst, const char *name, char *buf, DWORD heap_free(tmp); } midl_user_free(value); - heap_free(nameW); return r; }