Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
7b89ff88
Commit
7b89ff88
authored
Oct 06, 2006
by
James Hawkins
Committed by
Alexandre Julliard
Oct 07, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
janitorial: Remove redundant NULL checks before SHFree.
parent
99e2c6df
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
36 additions
and
68 deletions
+36
-68
brsfolder.c
dlls/shell32/brsfolder.c
+1
-3
changenotify.c
dlls/shell32/changenotify.c
+2
-2
cpanelfolder.c
dlls/shell32/cpanelfolder.c
+1
-2
dataobject.c
dlls/shell32/dataobject.c
+1
-4
pidl.c
dlls/shell32/pidl.c
+4
-9
shell.c
dlls/shell32/shell.c
+4
-4
shell32_main.c
dlls/shell32/shell32_main.c
+1
-2
shfldr_desktop.c
dlls/shell32/shfldr_desktop.c
+2
-4
shfldr_fs.c
dlls/shell32/shfldr_fs.c
+5
-11
shfldr_mycomp.c
dlls/shell32/shfldr_mycomp.c
+1
-2
shlexec.c
dlls/shell32/shlexec.c
+7
-7
shlmenu.c
dlls/shell32/shlmenu.c
+3
-8
shlview.c
dlls/shell32/shlview.c
+2
-6
shv_item_cmenu.c
dlls/shell32/shv_item_cmenu.c
+1
-2
trash.c
dlls/shell32/trash.c
+1
-2
No files found.
dlls/shell32/brsfolder.c
View file @
7b89ff88
...
@@ -354,9 +354,7 @@ static void FillTreeView( browse_info *info, IShellFolder * lpsf,
...
@@ -354,9 +354,7 @@ static void FillTreeView( browse_info *info, IShellFolder * lpsf,
done:
done:
ReleaseCapture
();
ReleaseCapture
();
SetCursor
(
LoadCursorW
(
0
,
(
LPWSTR
)
IDC_ARROW
));
SetCursor
(
LoadCursorW
(
0
,
(
LPWSTR
)
IDC_ARROW
));
SHFree
(
pidlTemp
);
if
(
pidlTemp
)
SHFree
(
pidlTemp
);
}
}
static
inline
BOOL
PIDLIsType
(
LPCITEMIDLIST
pidl
,
PIDLTYPE
type
)
static
inline
BOOL
PIDLIsType
(
LPCITEMIDLIST
pidl
,
PIDLTYPE
type
)
...
...
dlls/shell32/changenotify.c
View file @
7b89ff88
...
@@ -402,8 +402,8 @@ void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID
...
@@ -402,8 +402,8 @@ void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID
/* if we allocated it, free it. The ANSI flag is also set in its Unicode sibling. */
/* if we allocated it, free it. The ANSI flag is also set in its Unicode sibling. */
if
((
typeFlag
&
SHCNF_PATHA
)
||
(
typeFlag
&
SHCNF_PRINTERA
))
if
((
typeFlag
&
SHCNF_PATHA
)
||
(
typeFlag
&
SHCNF_PRINTERA
))
{
{
if
(
Pidls
[
0
])
SHFree
((
LPITEMIDLIST
)
Pidls
[
0
]);
SHFree
((
LPITEMIDLIST
)
Pidls
[
0
]);
if
(
Pidls
[
1
])
SHFree
((
LPITEMIDLIST
)
Pidls
[
1
]);
SHFree
((
LPITEMIDLIST
)
Pidls
[
1
]);
}
}
}
}
...
...
dlls/shell32/cpanelfolder.c
View file @
7b89ff88
...
@@ -203,8 +203,7 @@ static ULONG WINAPI ISF_ControlPanel_fnRelease(IShellFolder2 * iface)
...
@@ -203,8 +203,7 @@ static ULONG WINAPI ISF_ControlPanel_fnRelease(IShellFolder2 * iface)
if
(
!
refCount
)
{
if
(
!
refCount
)
{
TRACE
(
"-- destroying IShellFolder(%p)
\n
"
,
This
);
TRACE
(
"-- destroying IShellFolder(%p)
\n
"
,
This
);
if
(
This
->
pidlRoot
)
SHFree
(
This
->
pidlRoot
);
SHFree
(
This
->
pidlRoot
);
LocalFree
((
HLOCAL
)
This
);
LocalFree
((
HLOCAL
)
This
);
}
}
return
refCount
;
return
refCount
;
...
...
dlls/shell32/dataobject.c
View file @
7b89ff88
...
@@ -97,10 +97,7 @@ static ULONG WINAPI IEnumFORMATETC_fnRelease(LPENUMFORMATETC iface)
...
@@ -97,10 +97,7 @@ static ULONG WINAPI IEnumFORMATETC_fnRelease(LPENUMFORMATETC iface)
if
(
!
refCount
)
if
(
!
refCount
)
{
{
TRACE
(
" destroying IEnumFORMATETC(%p)
\n
"
,
This
);
TRACE
(
" destroying IEnumFORMATETC(%p)
\n
"
,
This
);
if
(
This
->
pFmt
)
SHFree
(
This
->
pFmt
);
{
SHFree
(
This
->
pFmt
);
}
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
return
0
;
return
0
;
}
}
...
...
dlls/shell32/pidl.c
View file @
7b89ff88
...
@@ -291,11 +291,8 @@ HRESULT WINAPI ILLoadFromStream (IStream * pStream, LPITEMIDLIST * ppPidl)
...
@@ -291,11 +291,8 @@ HRESULT WINAPI ILLoadFromStream (IStream * pStream, LPITEMIDLIST * ppPidl)
TRACE_
(
shell
)(
"%p %p
\n
"
,
pStream
,
ppPidl
);
TRACE_
(
shell
)(
"%p %p
\n
"
,
pStream
,
ppPidl
);
if
(
*
ppPidl
)
SHFree
(
*
ppPidl
);
{
*
ppPidl
=
NULL
;
SHFree
(
*
ppPidl
);
*
ppPidl
=
NULL
;
}
IStream_AddRef
(
pStream
);
IStream_AddRef
(
pStream
);
...
@@ -865,8 +862,7 @@ LPITEMIDLIST WINAPI ILAppend(LPITEMIDLIST pidl, LPCITEMIDLIST item, BOOL bEnd)
...
@@ -865,8 +862,7 @@ LPITEMIDLIST WINAPI ILAppend(LPITEMIDLIST pidl, LPCITEMIDLIST item, BOOL bEnd)
if
(
_ILIsDesktop
(
pidl
))
if
(
_ILIsDesktop
(
pidl
))
{
{
idlRet
=
ILClone
(
item
);
idlRet
=
ILClone
(
item
);
if
(
pidl
)
SHFree
(
pidl
);
SHFree
(
pidl
);
return
idlRet
;
return
idlRet
;
}
}
...
@@ -896,8 +892,7 @@ LPITEMIDLIST WINAPI ILAppend(LPITEMIDLIST pidl, LPCITEMIDLIST item, BOOL bEnd)
...
@@ -896,8 +892,7 @@ LPITEMIDLIST WINAPI ILAppend(LPITEMIDLIST pidl, LPCITEMIDLIST item, BOOL bEnd)
void
WINAPI
ILFree
(
LPITEMIDLIST
pidl
)
void
WINAPI
ILFree
(
LPITEMIDLIST
pidl
)
{
{
TRACE
(
"(pidl=%p)
\n
"
,
pidl
);
TRACE
(
"(pidl=%p)
\n
"
,
pidl
);
if
(
pidl
)
SHFree
(
pidl
);
SHFree
(
pidl
);
}
}
/*************************************************************************
/*************************************************************************
...
...
dlls/shell32/shell.c
View file @
7b89ff88
...
@@ -628,10 +628,10 @@ HINSTANCE16 WINAPI ShellExecute16( HWND16 hWnd, LPCSTR lpOperation,
...
@@ -628,10 +628,10 @@ HINSTANCE16 WINAPI ShellExecute16( HWND16 hWnd, LPCSTR lpOperation,
SHELL_execute
(
&
seiW
,
SHELL_Execute16
);
SHELL_execute
(
&
seiW
,
SHELL_Execute16
);
if
(
wVerb
)
SHFree
(
wVerb
);
SHFree
(
wVerb
);
if
(
wFile
)
SHFree
(
wFile
);
SHFree
(
wFile
);
if
(
wParameters
)
SHFree
(
wParameters
);
SHFree
(
wParameters
);
if
(
wDirectory
)
SHFree
(
wDirectory
);
SHFree
(
wDirectory
);
return
HINSTANCE_16
(
seiW
.
hInstApp
);
return
HINSTANCE_16
(
seiW
.
hInstApp
);
}
}
dlls/shell32/shell32_main.c
View file @
7b89ff88
...
@@ -614,8 +614,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
...
@@ -614,8 +614,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes,
if
(
hr
!=
S_OK
)
if
(
hr
!=
S_OK
)
ret
=
FALSE
;
ret
=
FALSE
;
if
(
pidlLast
)
SHFree
(
pidlLast
);
SHFree
(
pidlLast
);
#ifdef MORE_DEBUG
#ifdef MORE_DEBUG
TRACE
(
"icon=%p index=0x%08x attr=0x%08lx name=%s type=%s ret=0x%08lx
\n
"
,
TRACE
(
"icon=%p index=0x%08x attr=0x%08lx name=%s type=%s ret=0x%08lx
\n
"
,
...
...
dlls/shell32/shfldr_desktop.c
View file @
7b89ff88
...
@@ -137,10 +137,8 @@ static ULONG WINAPI ISF_Desktop_fnRelease (IShellFolder2 * iface)
...
@@ -137,10 +137,8 @@ static ULONG WINAPI ISF_Desktop_fnRelease (IShellFolder2 * iface)
if
(
!
refCount
)
if
(
!
refCount
)
{
{
TRACE
(
"-- destroying IShellFolder(%p)
\n
"
,
This
);
TRACE
(
"-- destroying IShellFolder(%p)
\n
"
,
This
);
if
(
This
->
pidlRoot
)
SHFree
(
This
->
pidlRoot
);
SHFree
(
This
->
pidlRoot
);
SHFree
(
This
->
sPathTarget
);
if
(
This
->
sPathTarget
)
SHFree
(
This
->
sPathTarget
);
LocalFree
((
HLOCAL
)
This
);
LocalFree
((
HLOCAL
)
This
);
return
0
;
return
0
;
}
}
...
...
dlls/shell32/shfldr_fs.c
View file @
7b89ff88
...
@@ -194,10 +194,8 @@ static ULONG WINAPI IUnknown_fnRelease (IUnknown * iface)
...
@@ -194,10 +194,8 @@ static ULONG WINAPI IUnknown_fnRelease (IUnknown * iface)
if
(
!
refCount
)
{
if
(
!
refCount
)
{
TRACE
(
"-- destroying IShellFolder(%p)
\n
"
,
This
);
TRACE
(
"-- destroying IShellFolder(%p)
\n
"
,
This
);
if
(
This
->
pidlRoot
)
SHFree
(
This
->
pidlRoot
);
SHFree
(
This
->
pidlRoot
);
SHFree
(
This
->
sPathTarget
);
if
(
This
->
sPathTarget
)
SHFree
(
This
->
sPathTarget
);
LocalFree
((
HLOCAL
)
This
);
LocalFree
((
HLOCAL
)
This
);
}
}
return
refCount
;
return
refCount
;
...
@@ -1380,15 +1378,11 @@ IFSFldr_PersistFolder3_Initialize (IPersistFolder3 * iface, LPCITEMIDLIST pidl)
...
@@ -1380,15 +1378,11 @@ IFSFldr_PersistFolder3_Initialize (IPersistFolder3 * iface, LPCITEMIDLIST pidl)
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
pidl
);
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
pidl
);
if
(
This
->
pidlRoot
)
SHFree
(
This
->
pidlRoot
);
/* free the old pidl */
SHFree
(
This
->
pidlRoot
);
/* free the old pidl */
This
->
pidlRoot
=
ILClone
(
pidl
);
/* set my pidl */
This
->
pidlRoot
=
ILClone
(
pidl
);
/* set my pidl */
if
(
This
->
sPathTarget
)
SHFree
(
This
->
sPathTarget
);
{
This
->
sPathTarget
=
NULL
;
SHFree
(
This
->
sPathTarget
);
This
->
sPathTarget
=
NULL
;
}
/* set my path */
/* set my path */
if
(
SHGetPathFromIDListW
(
pidl
,
wszTemp
))
{
if
(
SHGetPathFromIDListW
(
pidl
,
wszTemp
))
{
...
...
dlls/shell32/shfldr_mycomp.c
View file @
7b89ff88
...
@@ -186,8 +186,7 @@ static ULONG WINAPI ISF_MyComputer_fnRelease (IShellFolder2 * iface)
...
@@ -186,8 +186,7 @@ static ULONG WINAPI ISF_MyComputer_fnRelease (IShellFolder2 * iface)
if
(
!
refCount
)
if
(
!
refCount
)
{
{
TRACE
(
"-- destroying IShellFolder(%p)
\n
"
,
This
);
TRACE
(
"-- destroying IShellFolder(%p)
\n
"
,
This
);
if
(
This
->
pidlRoot
)
SHFree
(
This
->
pidlRoot
);
SHFree
(
This
->
pidlRoot
);
LocalFree
((
HLOCAL
)
This
);
LocalFree
((
HLOCAL
)
This
);
}
}
return
refCount
;
return
refCount
;
...
...
dlls/shell32/shlexec.c
View file @
7b89ff88
...
@@ -882,8 +882,8 @@ HINSTANCE WINAPI FindExecutableA(LPCSTR lpFile, LPCSTR lpDirectory, LPSTR lpResu
...
@@ -882,8 +882,8 @@ HINSTANCE WINAPI FindExecutableA(LPCSTR lpFile, LPCSTR lpDirectory, LPSTR lpResu
retval
=
FindExecutableW
(
wFile
,
wDirectory
,
wResult
);
retval
=
FindExecutableW
(
wFile
,
wDirectory
,
wResult
);
WideCharToMultiByte
(
CP_ACP
,
0
,
wResult
,
-
1
,
lpResult
,
MAX_PATH
,
NULL
,
NULL
);
WideCharToMultiByte
(
CP_ACP
,
0
,
wResult
,
-
1
,
lpResult
,
MAX_PATH
,
NULL
,
NULL
);
if
(
wFile
)
SHFree
(
wFile
);
SHFree
(
wFile
);
if
(
wDirectory
)
SHFree
(
wDirectory
);
SHFree
(
wDirectory
);
TRACE
(
"returning %s
\n
"
,
lpResult
);
TRACE
(
"returning %s
\n
"
,
lpResult
);
return
retval
;
return
retval
;
...
@@ -1580,11 +1580,11 @@ BOOL WINAPI ShellExecuteExA (LPSHELLEXECUTEINFOA sei)
...
@@ -1580,11 +1580,11 @@ BOOL WINAPI ShellExecuteExA (LPSHELLEXECUTEINFOA sei)
if
(
sei
->
fMask
&
SEE_MASK_NOCLOSEPROCESS
)
if
(
sei
->
fMask
&
SEE_MASK_NOCLOSEPROCESS
)
sei
->
hProcess
=
seiW
.
hProcess
;
sei
->
hProcess
=
seiW
.
hProcess
;
if
(
wVerb
)
SHFree
(
wVerb
);
SHFree
(
wVerb
);
if
(
wFile
)
SHFree
(
wFile
);
SHFree
(
wFile
);
if
(
wParameters
)
SHFree
(
wParameters
);
SHFree
(
wParameters
);
if
(
wDirectory
)
SHFree
(
wDirectory
);
SHFree
(
wDirectory
);
if
(
wClass
)
SHFree
(
wClass
);
SHFree
(
wClass
);
return
ret
;
return
ret
;
}
}
...
...
dlls/shell32/shlmenu.c
View file @
7b89ff88
...
@@ -115,9 +115,7 @@ static LPFMINFO FM_SetMenuParameter(
...
@@ -115,9 +115,7 @@ static LPFMINFO FM_SetMenuParameter(
menudata
=
FM_GetMenuInfo
(
hmenu
);
menudata
=
FM_GetMenuInfo
(
hmenu
);
if
(
menudata
->
pidl
)
SHFree
(
menudata
->
pidl
);
{
SHFree
(
menudata
->
pidl
);
}
menudata
->
uID
=
uID
;
menudata
->
uID
=
uID
;
menudata
->
pidl
=
ILClone
(
pidl
);
menudata
->
pidl
=
ILClone
(
pidl
);
...
@@ -299,9 +297,7 @@ void WINAPI FileMenu_Destroy (HMENU hmenu)
...
@@ -299,9 +297,7 @@ void WINAPI FileMenu_Destroy (HMENU hmenu)
menudata
=
FM_GetMenuInfo
(
hmenu
);
menudata
=
FM_GetMenuInfo
(
hmenu
);
if
(
menudata
->
pidl
)
SHFree
(
menudata
->
pidl
);
{
SHFree
(
menudata
->
pidl
);
}
HeapFree
(
GetProcessHeap
(),
0
,
menudata
);
HeapFree
(
GetProcessHeap
(),
0
,
menudata
);
DestroyMenu
(
hmenu
);
DestroyMenu
(
hmenu
);
...
@@ -692,8 +688,7 @@ BOOL WINAPI FileMenu_DeleteAllItems (HMENU hmenu)
...
@@ -692,8 +688,7 @@ BOOL WINAPI FileMenu_DeleteAllItems (HMENU hmenu)
for
(
i
=
0
;
i
<
GetMenuItemCount
(
hmenu
);
i
++
)
for
(
i
=
0
;
i
<
GetMenuItemCount
(
hmenu
);
i
++
)
{
GetMenuItemInfoW
(
hmenu
,
i
,
TRUE
,
&
mii
);
{
GetMenuItemInfoW
(
hmenu
,
i
,
TRUE
,
&
mii
);
if
(
mii
.
dwItemData
)
SHFree
((
LPFMINFO
)
mii
.
dwItemData
);
SHFree
((
LPFMINFO
)
mii
.
dwItemData
);
if
(
mii
.
hSubMenu
)
if
(
mii
.
hSubMenu
)
FileMenu_Destroy
(
mii
.
hSubMenu
);
FileMenu_Destroy
(
mii
.
hSubMenu
);
...
...
dlls/shell32/shlview.c
View file @
7b89ff88
...
@@ -811,10 +811,7 @@ static UINT ShellView_GetSelections(IShellViewImpl * This)
...
@@ -811,10 +811,7 @@ static UINT ShellView_GetSelections(IShellViewImpl * This)
LVITEMA
lvItem
;
LVITEMA
lvItem
;
UINT
i
=
0
;
UINT
i
=
0
;
if
(
This
->
apidl
)
SHFree
(
This
->
apidl
);
{
SHFree
(
This
->
apidl
);
}
This
->
cidl
=
ListView_GetSelectedCount
(
This
->
hWndList
);
This
->
cidl
=
ListView_GetSelectedCount
(
This
->
hWndList
);
This
->
apidl
=
(
LPITEMIDLIST
*
)
SHAlloc
(
This
->
cidl
*
sizeof
(
LPITEMIDLIST
));
This
->
apidl
=
(
LPITEMIDLIST
*
)
SHAlloc
(
This
->
cidl
*
sizeof
(
LPITEMIDLIST
));
...
@@ -1713,8 +1710,7 @@ static ULONG WINAPI IShellView_fnRelease(IShellView * iface)
...
@@ -1713,8 +1710,7 @@ static ULONG WINAPI IShellView_fnRelease(IShellView * iface)
if
(
This
->
pSF2Parent
)
if
(
This
->
pSF2Parent
)
IShellFolder2_Release
(
This
->
pSF2Parent
);
IShellFolder2_Release
(
This
->
pSF2Parent
);
if
(
This
->
apidl
)
SHFree
(
This
->
apidl
);
SHFree
(
This
->
apidl
);
if
(
This
->
pAdvSink
)
if
(
This
->
pAdvSink
)
IAdviseSink_Release
(
This
->
pAdvSink
);
IAdviseSink_Release
(
This
->
pAdvSink
);
...
...
dlls/shell32/shv_item_cmenu.c
View file @
7b89ff88
...
@@ -166,8 +166,7 @@ static ULONG WINAPI ISvItemCm_fnRelease(IContextMenu2 *iface)
...
@@ -166,8 +166,7 @@ static ULONG WINAPI ISvItemCm_fnRelease(IContextMenu2 *iface)
if
(
This
->
pSFParent
)
if
(
This
->
pSFParent
)
IShellFolder_Release
(
This
->
pSFParent
);
IShellFolder_Release
(
This
->
pSFParent
);
if
(
This
->
pidl
)
SHFree
(
This
->
pidl
);
SHFree
(
This
->
pidl
);
/*make sure the pidl is freed*/
/*make sure the pidl is freed*/
_ILFreeaPidl
(
This
->
apidl
,
This
->
cidl
);
_ILFreeaPidl
(
This
->
apidl
,
This
->
cidl
);
...
...
dlls/shell32/trash.c
View file @
7b89ff88
...
@@ -377,8 +377,7 @@ HRESULT TRASH_UnpackItemID(LPCSHITEMID id, TRASH_ELEMENT *element, WIN32_FIND_DA
...
@@ -377,8 +377,7 @@ HRESULT TRASH_UnpackItemID(LPCSHITEMID id, TRASH_ELEMENT *element, WIN32_FIND_DA
void
TRASH_DisposeElement
(
TRASH_ELEMENT
*
element
)
void
TRASH_DisposeElement
(
TRASH_ELEMENT
*
element
)
{
{
if
(
element
)
SHFree
(
element
->
filename
);
SHFree
(
element
->
filename
);
}
}
HRESULT
TRASH_GetDetails
(
const
TRASH_ELEMENT
*
element
,
WIN32_FIND_DATAW
*
data
)
HRESULT
TRASH_GetDetails
(
const
TRASH_ELEMENT
*
element
,
WIN32_FIND_DATAW
*
data
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment