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

[misc] fix Coverity warnings

This commit is contained in:
Pete Batard 2016-03-25 16:38:01 +00:00
parent e4bb1a6eb8
commit 0d310d1c6b
4 changed files with 14 additions and 10 deletions

View file

@ -1,5 +1,5 @@
@echo off @echo off
set COV_DIR=E:\cov-analysis-win32-7.7.0 set COV_DIR=E:\cov-analysis-win32-7.7.0.4
set PATH=%PATH%;%COV_DIR%\bin set PATH=%PATH%;%COV_DIR%\bin
set PWD=%~dp0 set PWD=%~dp0
rmdir cov-int /s /q >NUL 2>NUL rmdir cov-int /s /q >NUL 2>NUL

View file

@ -122,6 +122,9 @@ static __inline BOOL _SetRegistryKey(HKEY key_root, const char* key_name, DWORD
HKEY hRoot = NULL, hApp = NULL; HKEY hRoot = NULL, hApp = NULL;
DWORD dwDisp, dwType = reg_type; DWORD dwDisp, dwType = reg_type;
if (key_name == NULL)
return FALSE;
if (RegOpenKeyExA(key_root, NULL, 0, KEY_READ|KEY_CREATE_SUB_KEY, &hRoot) != ERROR_SUCCESS) { if (RegOpenKeyExA(key_root, NULL, 0, KEY_READ|KEY_CREATE_SUB_KEY, &hRoot) != ERROR_SUCCESS) {
hRoot = NULL; hRoot = NULL;
goto out; goto out;

View file

@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 242, 376 IDD_DIALOG DIALOGEX 12, 12, 242, 376
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 2.8.888" CAPTION "Rufus 2.8.889"
FONT 8, "Segoe UI Symbol", 400, 0, 0x0 FONT 8, "Segoe UI Symbol", 400, 0, 0x0
BEGIN BEGIN
LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8 LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8
@ -320,8 +320,8 @@ END
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,8,888,0 FILEVERSION 2,8,889,0
PRODUCTVERSION 2,8,888,0 PRODUCTVERSION 2,8,889,0
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -338,13 +338,13 @@ BEGIN
BEGIN BEGIN
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)" VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
VALUE "FileDescription", "Rufus" VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "2.8.888" VALUE "FileVersion", "2.8.889"
VALUE "InternalName", "Rufus" VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2016 Pete Batard (GPL v3)" VALUE "LegalCopyright", "© 2011-2016 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus.exe" VALUE "OriginalFilename", "rufus.exe"
VALUE "ProductName", "Rufus" VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "2.8.888" VALUE "ProductVersion", "2.8.889"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"

View file

@ -175,10 +175,10 @@ void BrowseForFolder(void) {
hr = (*pfSHCreateItemFromParsingName)(wpath, NULL, &IID_IShellItem, (LPVOID)&si_path); hr = (*pfSHCreateItemFromParsingName)(wpath, NULL, &IID_IShellItem, (LPVOID)&si_path);
if (SUCCEEDED(hr)) { if (SUCCEEDED(hr)) {
if (wpath != NULL) { if (wpath != NULL) {
hr = pfod->lpVtbl->SetFolder(pfod, si_path); pfod->lpVtbl->SetFolder(pfod, si_path);
} }
if (fname != NULL) { if (fname != NULL) {
hr = pfod->lpVtbl->SetFileName(pfod, fname); pfod->lpVtbl->SetFileName(pfod, fname);
} }
} }
safe_free(wpath); safe_free(wpath);
@ -250,7 +250,7 @@ char* FileDialog(BOOL save, char* path, const ext_t* ext, DWORD options)
HRESULT hr = FALSE; HRESULT hr = FALSE;
IFileDialog *pfd = NULL; IFileDialog *pfd = NULL;
IShellItem *psiResult; IShellItem *psiResult;
COMDLG_FILTERSPEC* filter_spec; COMDLG_FILTERSPEC* filter_spec = NULL;
wchar_t *wpath = NULL, *wfilename = NULL; wchar_t *wpath = NULL, *wfilename = NULL;
IShellItem *si_path = NULL; // Automatically freed IShellItem *si_path = NULL; // Automatically freed
@ -333,7 +333,8 @@ char* FileDialog(BOOL save, char* path, const ext_t* ext, DWORD options)
dialog_showing--; dialog_showing--;
return filepath; return filepath;
} }
fallback: fallback:
safe_free(filter_spec);
if (pfd != NULL) { if (pfd != NULL) {
pfd->lpVtbl->Release(pfd); pfd->lpVtbl->Release(pfd);
} }