[WINESYNC] msi: Avoid leaking memory on failure paths in MsiGetPropertyA().

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id 2e2934e455318c2753741a051876bc0a3c2399fa by Zebediah Figura <z.figura12@gmail.com>
This commit is contained in:
winesync 2022-03-12 15:12:17 +01:00 committed by Mark Jansen
parent 4f51867f22
commit 02726bbc20
No known key found for this signature in database
GPG key ID: B39240EE84BEAE8B

View file

@ -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;
}