1
1
Fork 0
mirror of https://github.com/pbatard/rufus.git synced 2024-08-14 23:57:05 +00:00

[net] fix a small memory leak in the update check

* A 257-byte signature buffer was not being freed if check for BETAs was enabled.
This commit is contained in:
Pete Batard 2019-10-24 13:05:07 +01:00
parent 8719412667
commit 7ec7331200
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
2 changed files with 8 additions and 6 deletions

View file

@ -699,6 +699,9 @@ static DWORD WINAPI CheckForUpdatesThread(LPVOID param)
#endif #endif
vuprintf("Using %s for the update check", RUFUS_URL); vuprintf("Using %s for the update check", RUFUS_URL);
for (k=0; (k<max_channel) && (!found_new_version); k++) { for (k=0; (k<max_channel) && (!found_new_version); k++) {
// Free any previous buffers we might have used
safe_free(buf);
safe_free(sig);
uprintf("Checking %s channel...", channel[k]); uprintf("Checking %s channel...", channel[k]);
// At this stage we can query the server for various update version files. // At this stage we can query the server for various update version files.
// We first try to lookup for "<appname>_<os_arch>_<os_version_major>_<os_version_minor>.ver" // We first try to lookup for "<appname>_<os_arch>_<os_version_major>_<os_version_minor>.ver"
@ -770,7 +773,6 @@ static DWORD WINAPI CheckForUpdatesThread(LPVOID param)
if (!pfHttpQueryInfoA(hRequest, HTTP_QUERY_CONTENT_LENGTH|HTTP_QUERY_FLAG_NUMBER, (LPVOID)&dwTotalSize, &dwSize, NULL)) if (!pfHttpQueryInfoA(hRequest, HTTP_QUERY_CONTENT_LENGTH|HTTP_QUERY_FLAG_NUMBER, (LPVOID)&dwTotalSize, &dwSize, NULL))
goto out; goto out;
safe_free(buf);
// Make sure the file is NUL terminated // Make sure the file is NUL terminated
buf = (char*)calloc(dwTotalSize+1, 1); buf = (char*)calloc(dwTotalSize+1, 1);
if (buf == NULL) if (buf == NULL)

View file

@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 232, 326 IDD_DIALOG DIALOGEX 12, 12, 232, 326
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_ACCEPTFILES EXSTYLE WS_EX_ACCEPTFILES
CAPTION "Rufus 3.9.1584" CAPTION "Rufus 3.9.1585"
FONT 9, "Segoe UI Symbol", 400, 0, 0x0 FONT 9, "Segoe UI Symbol", 400, 0, 0x0
BEGIN BEGIN
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
@ -394,8 +394,8 @@ END
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,9,1584,0 FILEVERSION 3,9,1585,0
PRODUCTVERSION 3,9,1584,0 PRODUCTVERSION 3,9,1585,0
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -413,13 +413,13 @@ BEGIN
VALUE "Comments", "https://rufus.ie" VALUE "Comments", "https://rufus.ie"
VALUE "CompanyName", "Akeo Consulting" VALUE "CompanyName", "Akeo Consulting"
VALUE "FileDescription", "Rufus" VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "3.9.1584" VALUE "FileVersion", "3.9.1585"
VALUE "InternalName", "Rufus" VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2019 Pete Batard (GPL v3)" VALUE "LegalCopyright", "© 2011-2019 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html" VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
VALUE "OriginalFilename", "rufus-3.9.exe" VALUE "OriginalFilename", "rufus-3.9.exe"
VALUE "ProductName", "Rufus" VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "3.9.1584" VALUE "ProductVersion", "3.9.1585"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"