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
8784d47c
Commit
8784d47c
authored
Feb 13, 2007
by
Felix Nawothnig
Committed by
Alexandre Julliard
Feb 14, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Remove redundant NULL checks before Free() calls.
parent
43c0ce16
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
29 additions
and
67 deletions
+29
-67
comboex.c
dlls/comctl32/comboex.c
+5
-5
comctl32undoc.c
dlls/comctl32/comctl32undoc.c
+4
-6
header.c
dlls/comctl32/header.c
+7
-20
listview.c
dlls/comctl32/listview.c
+1
-2
monthcal.c
dlls/comctl32/monthcal.c
+2
-3
propsheet.c
dlls/comctl32/propsheet.c
+1
-2
syslink.c
dlls/comctl32/syslink.c
+5
-21
tab.c
dlls/comctl32/tab.c
+2
-5
treeview.c
dlls/comctl32/treeview.c
+2
-3
No files found.
dlls/comctl32/comboex.c
View file @
8784d47c
...
@@ -227,7 +227,7 @@ COMBOEX_NotifyItem (COMBOEX_INFO *infoPtr, INT code, NMCOMBOBOXEXW *hdr)
...
@@ -227,7 +227,7 @@ COMBOEX_NotifyItem (COMBOEX_INFO *infoPtr, INT code, NMCOMBOBOXEXW *hdr)
if
(
astr
&&
hdr
->
ceItem
.
pszText
==
(
LPWSTR
)
astr
)
if
(
astr
&&
hdr
->
ceItem
.
pszText
==
(
LPWSTR
)
astr
)
hdr
->
ceItem
.
pszText
=
wstr
;
hdr
->
ceItem
.
pszText
=
wstr
;
if
(
astr
)
Free
(
astr
);
Free
(
astr
);
return
ret
;
return
ret
;
}
}
...
@@ -278,7 +278,7 @@ static void COMBOEX_FreeText (CBE_ITEMDATA *item)
...
@@ -278,7 +278,7 @@ static void COMBOEX_FreeText (CBE_ITEMDATA *item)
{
{
if
(
is_textW
(
item
->
pszText
))
Free
(
item
->
pszText
);
if
(
is_textW
(
item
->
pszText
))
Free
(
item
->
pszText
);
item
->
pszText
=
0
;
item
->
pszText
=
0
;
if
(
item
->
pszTemp
)
Free
(
item
->
pszTemp
);
Free
(
item
->
pszTemp
);
item
->
pszTemp
=
0
;
item
->
pszTemp
=
0
;
}
}
...
@@ -327,7 +327,7 @@ static LPCWSTR COMBOEX_GetText(COMBOEX_INFO *infoPtr, CBE_ITEMDATA *item)
...
@@ -327,7 +327,7 @@ static LPCWSTR COMBOEX_GetText(COMBOEX_INFO *infoPtr, CBE_ITEMDATA *item)
COMBOEX_FreeText
(
item
);
COMBOEX_FreeText
(
item
);
item
->
pszText
=
buf
;
item
->
pszText
=
buf
;
}
else
{
}
else
{
if
(
item
->
pszTemp
)
Free
(
item
->
pszTemp
);
Free
(
item
->
pszTemp
);
item
->
pszTemp
=
buf
;
item
->
pszTemp
=
buf
;
}
}
text
=
buf
;
text
=
buf
;
...
@@ -701,7 +701,7 @@ static INT COMBOEX_InsertItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA *cit)
...
@@ -701,7 +701,7 @@ static INT COMBOEX_InsertItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA *cit)
}
}
ret
=
COMBOEX_InsertItemW
(
infoPtr
,
&
citW
);
ret
=
COMBOEX_InsertItemW
(
infoPtr
,
&
citW
);
if
(
wstr
)
Free
(
wstr
);
Free
(
wstr
);
return
ret
;
return
ret
;
}
}
...
@@ -825,7 +825,7 @@ static BOOL COMBOEX_SetItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA *cit)
...
@@ -825,7 +825,7 @@ static BOOL COMBOEX_SetItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA *cit)
}
}
ret
=
COMBOEX_SetItemW
(
infoPtr
,
&
citW
);
ret
=
COMBOEX_SetItemW
(
infoPtr
,
&
citW
);
if
(
wstr
)
Free
(
wstr
);
Free
(
wstr
);
return
ret
;
return
ret
;
}
}
...
...
dlls/comctl32/comctl32undoc.c
View file @
8784d47c
...
@@ -351,10 +351,9 @@ void WINAPI FreeMRUList (HANDLE hMRUList)
...
@@ -351,10 +351,9 @@ void WINAPI FreeMRUList (HANDLE hMRUList)
MRU_SaveChanged
(
mp
);
MRU_SaveChanged
(
mp
);
}
}
for
(
i
=
0
;
i
<
mp
->
extview
.
nMaxItems
;
i
++
)
{
for
(
i
=
0
;
i
<
mp
->
extview
.
nMaxItems
;
i
++
)
if
(
mp
->
array
[
i
])
Free
(
mp
->
array
[
i
]);
Free
(
mp
->
array
[
i
]);
}
Free
(
mp
->
realMRU
);
Free
(
mp
->
realMRU
);
Free
(
mp
->
array
);
Free
(
mp
->
array
);
Free
(
mp
->
extview
.
lpszSubKey
);
Free
(
mp
->
extview
.
lpszSubKey
);
...
@@ -422,8 +421,7 @@ INT WINAPI FindMRUData (HANDLE hList, LPCVOID lpData, DWORD cbData,
...
@@ -422,8 +421,7 @@ INT WINAPI FindMRUData (HANDLE hList, LPCVOID lpData, DWORD cbData,
}
}
}
}
}
}
if
(
dataA
)
Free
(
dataA
);
Free
(
dataA
);
if
(
i
<
mp
->
cursize
)
if
(
i
<
mp
->
cursize
)
ret
=
i
;
ret
=
i
;
else
else
...
...
dlls/comctl32/header.c
View file @
8784d47c
...
@@ -113,14 +113,6 @@ static LRESULT HEADER_SendCtrlCustomDraw(HWND hwnd, DWORD dwDrawStage, HDC hdc,
...
@@ -113,14 +113,6 @@ static LRESULT HEADER_SendCtrlCustomDraw(HWND hwnd, DWORD dwDrawStage, HDC hdc,
static
const
WCHAR
themeClass
[]
=
{
'H'
,
'e'
,
'a'
,
'd'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
themeClass
[]
=
{
'H'
,
'e'
,
'a'
,
'd'
,
'e'
,
'r'
,
0
};
static
WCHAR
emptyString
[]
=
{
0
};
static
WCHAR
emptyString
[]
=
{
0
};
static
void
HEADER_DisposeItem
(
HEADER_ITEM
*
lpItem
)
{
if
(
lpItem
->
pszText
)
{
Free
(
lpItem
->
pszText
);
}
}
static
void
HEADER_StoreHDItemInHeader
(
HEADER_ITEM
*
lpItem
,
UINT
mask
,
HDITEMW
*
phdi
,
BOOL
fUnicode
)
static
void
HEADER_StoreHDItemInHeader
(
HEADER_ITEM
*
lpItem
,
UINT
mask
,
HDITEMW
*
phdi
,
BOOL
fUnicode
)
{
{
if
(
mask
&
HDI_UNSUPPORTED_FIELDS
)
if
(
mask
&
HDI_UNSUPPORTED_FIELDS
)
...
@@ -149,11 +141,8 @@ static void HEADER_StoreHDItemInHeader(HEADER_ITEM *lpItem, UINT mask, HDITEMW *
...
@@ -149,11 +141,8 @@ static void HEADER_StoreHDItemInHeader(HEADER_ITEM *lpItem, UINT mask, HDITEMW *
if
(
mask
&
HDI_TEXT
)
if
(
mask
&
HDI_TEXT
)
{
{
if
(
lpItem
->
pszText
)
Free
(
lpItem
->
pszText
);
{
lpItem
->
pszText
=
NULL
;
Free
(
lpItem
->
pszText
);
lpItem
->
pszText
=
NULL
;
}
if
(
phdi
->
pszText
!=
LPSTR_TEXTCALLBACKW
)
/* covers != TEXTCALLBACKA too */
if
(
phdi
->
pszText
!=
LPSTR_TEXTCALLBACKW
)
/* covers != TEXTCALLBACKA too */
{
{
...
@@ -1093,7 +1082,7 @@ HEADER_DeleteItem (HWND hwnd, WPARAM wParam)
...
@@ -1093,7 +1082,7 @@ HEADER_DeleteItem (HWND hwnd, WPARAM wParam)
TRACE
(
"%d: order=%d, iOrder=%d, ->iOrder=%d
\n
"
,
i
,
infoPtr
->
order
[
i
],
infoPtr
->
items
[
i
].
iOrder
,
infoPtr
->
items
[
infoPtr
->
order
[
i
]].
iOrder
);
TRACE
(
"%d: order=%d, iOrder=%d, ->iOrder=%d
\n
"
,
i
,
infoPtr
->
order
[
i
],
infoPtr
->
items
[
i
].
iOrder
,
infoPtr
->
items
[
infoPtr
->
order
[
i
]].
iOrder
);
iOrder
=
infoPtr
->
items
[
iItem
].
iOrder
;
iOrder
=
infoPtr
->
items
[
iItem
].
iOrder
;
HEADER_DisposeItem
(
&
infoPtr
->
items
[
iItem
]
);
Free
(
infoPtr
->
items
[
iItem
].
pszText
);
infoPtr
->
uNumItem
--
;
infoPtr
->
uNumItem
--
;
memmove
(
&
infoPtr
->
items
[
iItem
],
&
infoPtr
->
items
[
iItem
+
1
],
memmove
(
&
infoPtr
->
items
[
iItem
],
&
infoPtr
->
items
[
iItem
+
1
],
...
@@ -1422,7 +1411,7 @@ HEADER_SetItemT (HWND hwnd, INT nItem, LPHDITEMW phdi, BOOL bUnicode)
...
@@ -1422,7 +1411,7 @@ HEADER_SetItemT (HWND hwnd, INT nItem, LPHDITEMW phdi, BOOL bUnicode)
HEADER_CopyHDItemForNotify
(
infoPtr
,
&
hdNotify
,
phdi
,
bUnicode
,
&
pvScratch
);
HEADER_CopyHDItemForNotify
(
infoPtr
,
&
hdNotify
,
phdi
,
bUnicode
,
&
pvScratch
);
if
(
HEADER_SendNotifyWithHDItemT
(
hwnd
,
HDN_ITEMCHANGINGW
,
nItem
,
&
hdNotify
))
if
(
HEADER_SendNotifyWithHDItemT
(
hwnd
,
HDN_ITEMCHANGINGW
,
nItem
,
&
hdNotify
))
{
{
if
(
pvScratch
)
Free
(
pvScratch
);
Free
(
pvScratch
);
return
FALSE
;
return
FALSE
;
}
}
...
@@ -1439,8 +1428,7 @@ HEADER_SetItemT (HWND hwnd, INT nItem, LPHDITEMW phdi, BOOL bUnicode)
...
@@ -1439,8 +1428,7 @@ HEADER_SetItemT (HWND hwnd, INT nItem, LPHDITEMW phdi, BOOL bUnicode)
InvalidateRect
(
hwnd
,
NULL
,
FALSE
);
InvalidateRect
(
hwnd
,
NULL
,
FALSE
);
if
(
pvScratch
!=
NULL
)
Free
(
pvScratch
);
Free
(
pvScratch
);
return
TRUE
;
return
TRUE
;
}
}
...
@@ -1517,13 +1505,12 @@ HEADER_NCDestroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
...
@@ -1517,13 +1505,12 @@ HEADER_NCDestroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
if
(
infoPtr
->
items
)
{
if
(
infoPtr
->
items
)
{
lpItem
=
infoPtr
->
items
;
lpItem
=
infoPtr
->
items
;
for
(
nItem
=
0
;
nItem
<
infoPtr
->
uNumItem
;
nItem
++
,
lpItem
++
)
{
for
(
nItem
=
0
;
nItem
<
infoPtr
->
uNumItem
;
nItem
++
,
lpItem
++
)
{
HEADER_DisposeItem
(
lpItem
);
Free
(
lpItem
->
pszText
);
}
}
Free
(
infoPtr
->
items
);
Free
(
infoPtr
->
items
);
}
}
if
(
infoPtr
->
order
)
Free
(
infoPtr
->
order
);
Free
(
infoPtr
->
order
);
if
(
infoPtr
->
himl
)
if
(
infoPtr
->
himl
)
ImageList_Destroy
(
infoPtr
->
himl
);
ImageList_Destroy
(
infoPtr
->
himl
);
...
...
dlls/comctl32/listview.c
View file @
8784d47c
...
@@ -9964,8 +9964,7 @@ static LRESULT EditLblWndProcT(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPara
...
@@ -9964,8 +9964,7 @@ static LRESULT EditLblWndProcT(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPara
}
}
LISTVIEW_EndEditLabelT
(
infoPtr
,
buffer
,
isW
);
LISTVIEW_EndEditLabelT
(
infoPtr
,
buffer
,
isW
);
if
(
buffer
)
Free
(
buffer
);
Free
(
buffer
);
}
}
SendMessageW
(
hwnd
,
WM_CLOSE
,
0
,
0
);
SendMessageW
(
hwnd
,
WM_CLOSE
,
0
,
0
);
...
...
dlls/comctl32/monthcal.c
View file @
8784d47c
...
@@ -1909,10 +1909,9 @@ static LRESULT
...
@@ -1909,10 +1909,9 @@ static LRESULT
MONTHCAL_Destroy
(
MONTHCAL_INFO
*
infoPtr
)
MONTHCAL_Destroy
(
MONTHCAL_INFO
*
infoPtr
)
{
{
/* free month calendar info data */
/* free month calendar info data */
if
(
infoPtr
->
monthdayState
)
Free
(
infoPtr
->
monthdayState
);
Free
(
infoPtr
->
monthdayState
);
SetWindowLongPtrW
(
infoPtr
->
hwndSelf
,
0
,
0
);
SetWindowLongPtrW
(
infoPtr
->
hwndSelf
,
0
,
0
);
CloseThemeData
(
GetWindowTheme
(
infoPtr
->
hwndSelf
));
CloseThemeData
(
GetWindowTheme
(
infoPtr
->
hwndSelf
));
Free
(
infoPtr
);
Free
(
infoPtr
);
...
...
dlls/comctl32/propsheet.c
View file @
8784d47c
...
@@ -1494,8 +1494,7 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent,
...
@@ -1494,8 +1494,7 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent,
ppshpage
->
pfnDlgProc
,
ppshpage
->
pfnDlgProc
,
(
LPARAM
)
ppshpage
);
(
LPARAM
)
ppshpage
);
/* Free a no more needed copy */
/* Free a no more needed copy */
if
(
temp
)
Free
(
temp
);
Free
(
temp
);
psInfo
->
proppage
[
index
].
hwndPage
=
hwndPage
;
psInfo
->
proppage
[
index
].
hwndPage
=
hwndPage
;
...
...
dlls/comctl32/syslink.c
View file @
8784d47c
...
@@ -117,14 +117,8 @@ static VOID SYSLINK_FreeDocItem (PDOC_ITEM DocItem)
...
@@ -117,14 +117,8 @@ static VOID SYSLINK_FreeDocItem (PDOC_ITEM DocItem)
{
{
if
(
DocItem
->
Type
==
slLink
)
if
(
DocItem
->
Type
==
slLink
)
{
{
if
(
DocItem
->
u
.
Link
.
szID
!=
NULL
)
Free
(
DocItem
->
u
.
Link
.
szID
);
{
Free
(
DocItem
->
u
.
Link
.
szUrl
);
Free
(
DocItem
->
u
.
Link
.
szID
);
}
if
(
DocItem
->
u
.
Link
.
szUrl
!=
NULL
)
{
Free
(
DocItem
->
u
.
Link
.
szUrl
);
}
}
}
/* we don't free Text because it's just a pointer to a character in the
/* we don't free Text because it's just a pointer to a character in the
...
@@ -1081,11 +1075,7 @@ static LRESULT SYSLINK_SetItem (SYSLINK_INFO *infoPtr, PLITEM Item)
...
@@ -1081,11 +1075,7 @@ static LRESULT SYSLINK_SetItem (SYSLINK_INFO *infoPtr, PLITEM Item)
}
}
else
else
{
{
if
(
szId
)
Free
(
szId
);
{
Free
(
szId
);
}
ERR
(
"Unable to allocate memory for link url
\n
"
);
ERR
(
"Unable to allocate memory for link url
\n
"
);
return
FALSE
;
return
FALSE
;
}
}
...
@@ -1093,19 +1083,13 @@ static LRESULT SYSLINK_SetItem (SYSLINK_INFO *infoPtr, PLITEM Item)
...
@@ -1093,19 +1083,13 @@ static LRESULT SYSLINK_SetItem (SYSLINK_INFO *infoPtr, PLITEM Item)
if
(
Item
->
mask
&
LIF_ITEMID
)
if
(
Item
->
mask
&
LIF_ITEMID
)
{
{
if
(
di
->
u
.
Link
.
szID
)
Free
(
di
->
u
.
Link
.
szID
);
{
Free
(
di
->
u
.
Link
.
szID
);
}
di
->
u
.
Link
.
szID
=
szId
;
di
->
u
.
Link
.
szID
=
szId
;
}
}
if
(
Item
->
mask
&
LIF_URL
)
if
(
Item
->
mask
&
LIF_URL
)
{
{
if
(
di
->
u
.
Link
.
szUrl
)
Free
(
di
->
u
.
Link
.
szUrl
);
{
Free
(
di
->
u
.
Link
.
szUrl
);
}
di
->
u
.
Link
.
szUrl
=
szUrl
;
di
->
u
.
Link
.
szUrl
=
szUrl
;
}
}
...
...
dlls/comctl32/tab.c
View file @
8784d47c
...
@@ -2840,12 +2840,9 @@ static LRESULT TAB_DeleteItem (TAB_INFO *infoPtr, INT iItem)
...
@@ -2840,12 +2840,9 @@ static LRESULT TAB_DeleteItem (TAB_INFO *infoPtr, INT iItem)
{
{
TAB_ITEM
*
item
=
TAB_GetItem
(
infoPtr
,
iItem
);
TAB_ITEM
*
item
=
TAB_GetItem
(
infoPtr
,
iItem
);
LPBYTE
oldItems
=
(
LPBYTE
)
infoPtr
->
items
;
LPBYTE
oldItems
=
(
LPBYTE
)
infoPtr
->
items
;
TAB_InvalidateTabArea
(
infoPtr
);
if
(
item
->
pszText
)
Free
(
item
->
pszText
);
TAB_InvalidateTabArea
(
infoPtr
);
Free
(
item
->
pszText
);
infoPtr
->
uNumItem
--
;
infoPtr
->
uNumItem
--
;
if
(
!
infoPtr
->
uNumItem
)
if
(
!
infoPtr
->
uNumItem
)
...
...
dlls/comctl32/treeview.c
View file @
8784d47c
...
@@ -820,8 +820,7 @@ TREEVIEW_UpdateDispInfo(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
...
@@ -820,8 +820,7 @@ TREEVIEW_UpdateDispInfo(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
(
LPSTR
)
callback
.
item
.
pszText
,
-
1
,
(
LPSTR
)
callback
.
item
.
pszText
,
-
1
,
wineItem
->
pszText
,
buflen
/
sizeof
(
WCHAR
));
wineItem
->
pszText
,
buflen
/
sizeof
(
WCHAR
));
wineItem
->
cchTextMax
=
buflen
/
sizeof
(
WCHAR
);
wineItem
->
cchTextMax
=
buflen
/
sizeof
(
WCHAR
);
if
(
oldText
)
Free
(
oldText
);
Free
(
oldText
);
}
}
}
}
}
}
...
@@ -1484,7 +1483,7 @@ TREEVIEW_RemoveItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem)
...
@@ -1484,7 +1483,7 @@ TREEVIEW_RemoveItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem)
infoPtr
->
uNumItems
--
;
infoPtr
->
uNumItems
--
;
if
(
wineItem
->
pszText
&&
wineItem
->
pszText
!=
LPSTR_TEXTCALLBACKW
)
if
(
wineItem
->
pszText
!=
LPSTR_TEXTCALLBACKW
)
Free
(
wineItem
->
pszText
);
Free
(
wineItem
->
pszText
);
TREEVIEW_FreeItem
(
infoPtr
,
wineItem
);
TREEVIEW_FreeItem
(
infoPtr
,
wineItem
);
...
...
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