https://git.reactos.org/?p=reactos.git;a=commitdiff;h=02726bbc203528b50245b…
commit 02726bbc203528b50245b746e3a19d69a42bd903
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Sat Mar 12 15:12:17 2022 +0100
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sun Mar 20 19:27:46 2022 +0100
[WINESYNC] msi: Avoid leaking memory on failure paths in MsiGetPropertyA().
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com>
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id 2e2934e455318c2753741a051876bc0a3c2399fa by Zebediah Figura
<z.figura12(a)gmail.com>
---
dll/win32/msi/package.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
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;
}