mirror of
https://github.com/reactos/reactos.git
synced 2024-10-03 07:53:49 +00:00
[RAPPS]
- 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:
parent
2f3b278836
commit
55c6df28a8
|
@ -179,12 +179,16 @@ EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc)
|
||||||
if (!GetLocaleInfoW(GetUserDefaultLCID(), LOCALE_ILANGUAGE,
|
if (!GetLocaleInfoW(GetUserDefaultLCID(), LOCALE_ILANGUAGE,
|
||||||
szLocale, sizeof(szLocale) / sizeof(WCHAR)))
|
szLocale, sizeof(szLocale) / sizeof(WCHAR)))
|
||||||
{
|
{
|
||||||
|
FindClose(hFind);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = StringCbCatW(szSectionLocale, sizeof(szSectionLocale), szLocale);
|
hr = StringCbCatW(szSectionLocale, sizeof(szSectionLocale), szLocale);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
|
{
|
||||||
|
FindClose(hFind);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
#define GET_STRING1(a, b) \
|
#define GET_STRING1(a, b) \
|
||||||
if (!ParserGetString(szSectionLocale, a, b, MAX_PATH, FindFileData.cFileName)) \
|
if (!ParserGetString(szSectionLocale, a, b, MAX_PATH, FindFileData.cFileName)) \
|
||||||
|
|
|
@ -205,7 +205,7 @@ static
|
||||||
DWORD WINAPI
|
DWORD WINAPI
|
||||||
ThreadFunc(LPVOID Context)
|
ThreadFunc(LPVOID Context)
|
||||||
{
|
{
|
||||||
IBindStatusCallback *dl;
|
IBindStatusCallback *dl = NULL;
|
||||||
WCHAR path[MAX_PATH];
|
WCHAR path[MAX_PATH];
|
||||||
LPWSTR p;
|
LPWSTR p;
|
||||||
HWND Dlg = (HWND) Context;
|
HWND Dlg = (HWND) Context;
|
||||||
|
@ -262,6 +262,7 @@ ThreadFunc(LPVOID Context)
|
||||||
/* download it */
|
/* download it */
|
||||||
bTempfile = TRUE;
|
bTempfile = TRUE;
|
||||||
dl = CreateDl(Context, &bCancelled);
|
dl = CreateDl(Context, &bCancelled);
|
||||||
|
if (dl == NULL) goto end;
|
||||||
|
|
||||||
hOpen = InternetOpenW(lpszAgent, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
|
hOpen = InternetOpenW(lpszAgent, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
|
||||||
if (!hOpen) goto end;
|
if (!hOpen) goto end;
|
||||||
|
@ -282,9 +283,7 @@ ThreadFunc(LPVOID Context)
|
||||||
IBindStatusCallback_OnProgress(dl, dwCurrentBytesRead, dwContentLen, 0, AppInfo->szUrlDownload);
|
IBindStatusCallback_OnProgress(dl, dwCurrentBytesRead, dwContentLen, 0, AppInfo->szUrlDownload);
|
||||||
}
|
}
|
||||||
while (dwBytesRead);
|
while (dwBytesRead);
|
||||||
|
|
||||||
CloseHandle(hOut);
|
|
||||||
if (dl) IBindStatusCallback_Release(dl);
|
|
||||||
if (bCancelled) goto end;
|
if (bCancelled) goto end;
|
||||||
|
|
||||||
ShowWindow(Dlg, SW_HIDE);
|
ShowWindow(Dlg, SW_HIDE);
|
||||||
|
@ -299,6 +298,8 @@ end:
|
||||||
InternetCloseHandle(hFile);
|
InternetCloseHandle(hFile);
|
||||||
InternetCloseHandle(hOpen);
|
InternetCloseHandle(hOpen);
|
||||||
|
|
||||||
|
if (dl) IBindStatusCallback_Release(dl);
|
||||||
|
|
||||||
if (bTempfile)
|
if (bTempfile)
|
||||||
{
|
{
|
||||||
if (bCancelled || (SettingsInfo.bDelInstaller && !bCab))
|
if (bCancelled || (SettingsInfo.bDelInstaller && !bCab))
|
||||||
|
|
Loading…
Reference in a new issue