Commit 8ed06175 authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

msi: Free the temp buffer if we haven't assigned it to *appValue.

parent b530f38b
...@@ -739,6 +739,7 @@ static UINT ACTION_RecurseSearchDirectory(MSIPACKAGE *package, LPWSTR *appValue, ...@@ -739,6 +739,7 @@ static UINT ACTION_RecurseSearchDirectory(MSIPACKAGE *package, LPWSTR *appValue,
size_t dirLen = lstrlenW(dir), fileLen = lstrlenW(sig->File); size_t dirLen = lstrlenW(dir), fileLen = lstrlenW(sig->File);
WCHAR subpath[MAX_PATH]; WCHAR subpath[MAX_PATH];
WCHAR *buf; WCHAR *buf;
DWORD len;
static const WCHAR starDotStarW[] = { '*','.','*',0 }; static const WCHAR starDotStarW[] = { '*','.','*',0 };
...@@ -753,7 +754,8 @@ static UINT ACTION_RecurseSearchDirectory(MSIPACKAGE *package, LPWSTR *appValue, ...@@ -753,7 +754,8 @@ static UINT ACTION_RecurseSearchDirectory(MSIPACKAGE *package, LPWSTR *appValue,
* here. Add two because we might need to add a backslash if the dir name * here. Add two because we might need to add a backslash if the dir name
* isn't backslash-terminated. * isn't backslash-terminated.
*/ */
buf = msi_alloc( (dirLen + max(fileLen, strlenW(starDotStarW)) + 2) * sizeof(WCHAR)); len = dirLen + max(fileLen, strlenW(starDotStarW)) + 2;
buf = msi_alloc(len * sizeof(WCHAR));
if (!buf) if (!buf)
return ERROR_OUTOFMEMORY; return ERROR_OUTOFMEMORY;
...@@ -815,7 +817,7 @@ static UINT ACTION_RecurseSearchDirectory(MSIPACKAGE *package, LPWSTR *appValue, ...@@ -815,7 +817,7 @@ static UINT ACTION_RecurseSearchDirectory(MSIPACKAGE *package, LPWSTR *appValue,
} }
} }
if (!*appValue) if (*appValue != buf)
msi_free(buf); msi_free(buf);
return rc; return rc;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment