- Fix memory leaks
- Fix null-pointer dereference
- Fix user-after-free

CID #1206908
CID #1206915
CID #1206921
CID #1207022

svn path=/trunk/; revision=63021
This commit is contained in:
Pierre Schweitzer 2014-04-27 18:29:06 +00:00
parent 2f3b278836
commit 55c6df28a8
2 changed files with 9 additions and 4 deletions

View file

@ -179,12 +179,16 @@ EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc)
if (!GetLocaleInfoW(GetUserDefaultLCID(), LOCALE_ILANGUAGE,
szLocale, sizeof(szLocale) / sizeof(WCHAR)))
{
FindClose(hFind);
return FALSE;
}
hr = StringCbCatW(szSectionLocale, sizeof(szSectionLocale), szLocale);
if (FAILED(hr))
{
FindClose(hFind);
return FALSE;
}
#define GET_STRING1(a, b) \
if (!ParserGetString(szSectionLocale, a, b, MAX_PATH, FindFileData.cFileName)) \

View file

@ -205,7 +205,7 @@ static
DWORD WINAPI
ThreadFunc(LPVOID Context)
{
IBindStatusCallback *dl;
IBindStatusCallback *dl = NULL;
WCHAR path[MAX_PATH];
LPWSTR p;
HWND Dlg = (HWND) Context;
@ -262,6 +262,7 @@ ThreadFunc(LPVOID Context)
/* download it */
bTempfile = TRUE;
dl = CreateDl(Context, &bCancelled);
if (dl == NULL) goto end;
hOpen = InternetOpenW(lpszAgent, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
if (!hOpen) goto end;
@ -282,9 +283,7 @@ ThreadFunc(LPVOID Context)
IBindStatusCallback_OnProgress(dl, dwCurrentBytesRead, dwContentLen, 0, AppInfo->szUrlDownload);
}
while (dwBytesRead);
CloseHandle(hOut);
if (dl) IBindStatusCallback_Release(dl);
if (bCancelled) goto end;
ShowWindow(Dlg, SW_HIDE);
@ -299,6 +298,8 @@ end:
InternetCloseHandle(hFile);
InternetCloseHandle(hOpen);
if (dl) IBindStatusCallback_Release(dl);
if (bTempfile)
{
if (bCancelled || (SettingsInfo.bDelInstaller && !bCab))