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:
parent
e4bb1a6eb8
commit
0d310d1c6b
4 changed files with 14 additions and 10 deletions
|
@ -1,5 +1,5 @@
|
|||
@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 PWD=%~dp0
|
||||
rmdir cov-int /s /q >NUL 2>NUL
|
||||
|
|
|
@ -122,6 +122,9 @@ static __inline BOOL _SetRegistryKey(HKEY key_root, const char* key_name, DWORD
|
|||
HKEY hRoot = NULL, hApp = NULL;
|
||||
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) {
|
||||
hRoot = NULL;
|
||||
goto out;
|
||||
|
|
10
src/rufus.rc
10
src/rufus.rc
|
@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
|||
IDD_DIALOG DIALOGEX 12, 12, 242, 376
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
EXSTYLE WS_EX_ACCEPTFILES
|
||||
CAPTION "Rufus 2.8.888"
|
||||
CAPTION "Rufus 2.8.889"
|
||||
FONT 8, "Segoe UI Symbol", 400, 0, 0x0
|
||||
BEGIN
|
||||
LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8
|
||||
|
@ -320,8 +320,8 @@ END
|
|||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 2,8,888,0
|
||||
PRODUCTVERSION 2,8,888,0
|
||||
FILEVERSION 2,8,889,0
|
||||
PRODUCTVERSION 2,8,889,0
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
|
@ -338,13 +338,13 @@ BEGIN
|
|||
BEGIN
|
||||
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
|
||||
VALUE "FileDescription", "Rufus"
|
||||
VALUE "FileVersion", "2.8.888"
|
||||
VALUE "FileVersion", "2.8.889"
|
||||
VALUE "InternalName", "Rufus"
|
||||
VALUE "LegalCopyright", "© 2011-2016 Pete Batard (GPL v3)"
|
||||
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
|
||||
VALUE "OriginalFilename", "rufus.exe"
|
||||
VALUE "ProductName", "Rufus"
|
||||
VALUE "ProductVersion", "2.8.888"
|
||||
VALUE "ProductVersion", "2.8.889"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
|
|
@ -175,10 +175,10 @@ void BrowseForFolder(void) {
|
|||
hr = (*pfSHCreateItemFromParsingName)(wpath, NULL, &IID_IShellItem, (LPVOID)&si_path);
|
||||
if (SUCCEEDED(hr)) {
|
||||
if (wpath != NULL) {
|
||||
hr = pfod->lpVtbl->SetFolder(pfod, si_path);
|
||||
pfod->lpVtbl->SetFolder(pfod, si_path);
|
||||
}
|
||||
if (fname != NULL) {
|
||||
hr = pfod->lpVtbl->SetFileName(pfod, fname);
|
||||
pfod->lpVtbl->SetFileName(pfod, fname);
|
||||
}
|
||||
}
|
||||
safe_free(wpath);
|
||||
|
@ -250,7 +250,7 @@ char* FileDialog(BOOL save, char* path, const ext_t* ext, DWORD options)
|
|||
HRESULT hr = FALSE;
|
||||
IFileDialog *pfd = NULL;
|
||||
IShellItem *psiResult;
|
||||
COMDLG_FILTERSPEC* filter_spec;
|
||||
COMDLG_FILTERSPEC* filter_spec = NULL;
|
||||
wchar_t *wpath = NULL, *wfilename = NULL;
|
||||
IShellItem *si_path = NULL; // Automatically freed
|
||||
|
||||
|
@ -334,6 +334,7 @@ char* FileDialog(BOOL save, char* path, const ext_t* ext, DWORD options)
|
|||
return filepath;
|
||||
}
|
||||
fallback:
|
||||
safe_free(filter_spec);
|
||||
if (pfd != NULL) {
|
||||
pfd->lpVtbl->Release(pfd);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue