Skip to content

Commit 02726bb

Browse files
winesynclearn-more
authored andcommitted
[WINESYNC] msi: Avoid leaking memory on failure paths in MsiGetPropertyA().
Signed-off-by: Zebediah Figura <[email protected]> Signed-off-by: Hans Leidekker <[email protected]> Signed-off-by: Alexandre Julliard <[email protected]> wine commit id 2e2934e455318c2753741a051876bc0a3c2399fa by Zebediah Figura <[email protected]>
1 parent 4f51867 commit 02726bb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

dll/win32/msi/package.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2375,9 +2375,14 @@ UINT WINAPI MsiGetPropertyA(MSIHANDLE hinst, const char *name, char *buf, DWORD
23752375
DWORD len;
23762376

23772377
if (!(remote = msi_get_remote(hinst)))
2378+
{
2379+
heap_free(nameW);
23782380
return ERROR_INVALID_HANDLE;
2381+
}
23792382

23802383
r = remote_GetProperty(remote, nameW, &value, &len);
2384+
heap_free(nameW);
2385+
23812386
if (!r)
23822387
{
23832388
/* String might contain embedded nulls.
@@ -2395,7 +2400,6 @@ UINT WINAPI MsiGetPropertyA(MSIHANDLE hinst, const char *name, char *buf, DWORD
23952400
heap_free(tmp);
23962401
}
23972402
midl_user_free(value);
2398-
heap_free(nameW);
23992403
return r;
24002404
}
24012405

0 commit comments

Comments
 (0)