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
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
12 additions
and
50 deletions
+12
-50
comboex.c
dlls/comctl32/comboex.c
+5
-5
comctl32undoc.c
dlls/comctl32/comctl32undoc.c
+2
-4
header.c
dlls/comctl32/header.c
+3
-16
listview.c
dlls/comctl32/listview.c
+1
-2
monthcal.c
dlls/comctl32/monthcal.c
+0
-1
propsheet.c
dlls/comctl32/propsheet.c
+0
-1
syslink.c
dlls/comctl32/syslink.c
+0
-16
tab.c
dlls/comctl32/tab.c
+0
-3
treeview.c
dlls/comctl32/treeview.c
+1
-2
No files found.
dlls/comctl32/comboex.c
View file @
8784d47c
...
...
@@ -227,7 +227,7 @@ COMBOEX_NotifyItem (COMBOEX_INFO *infoPtr, INT code, NMCOMBOBOXEXW *hdr)
if
(
astr
&&
hdr
->
ceItem
.
pszText
==
(
LPWSTR
)
astr
)
hdr
->
ceItem
.
pszText
=
wstr
;
if
(
astr
)
Free
(
astr
);
Free
(
astr
);
return
ret
;
}
...
...
@@ -278,7 +278,7 @@ static void COMBOEX_FreeText (CBE_ITEMDATA *item)
{
if
(
is_textW
(
item
->
pszText
))
Free
(
item
->
pszText
);
item
->
pszText
=
0
;
if
(
item
->
pszTemp
)
Free
(
item
->
pszTemp
);
Free
(
item
->
pszTemp
);
item
->
pszTemp
=
0
;
}
...
...
@@ -327,7 +327,7 @@ static LPCWSTR COMBOEX_GetText(COMBOEX_INFO *infoPtr, CBE_ITEMDATA *item)
COMBOEX_FreeText
(
item
);
item
->
pszText
=
buf
;
}
else
{
if
(
item
->
pszTemp
)
Free
(
item
->
pszTemp
);
Free
(
item
->
pszTemp
);
item
->
pszTemp
=
buf
;
}
text
=
buf
;
...
...
@@ -701,7 +701,7 @@ static INT COMBOEX_InsertItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA *cit)
}
ret
=
COMBOEX_InsertItemW
(
infoPtr
,
&
citW
);
if
(
wstr
)
Free
(
wstr
);
Free
(
wstr
);
return
ret
;
}
...
...
@@ -825,7 +825,7 @@ static BOOL COMBOEX_SetItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA *cit)
}
ret
=
COMBOEX_SetItemW
(
infoPtr
,
&
citW
);
if
(
wstr
)
Free
(
wstr
);
Free
(
wstr
);
return
ret
;
}
...
...
dlls/comctl32/comctl32undoc.c
View file @
8784d47c
...
...
@@ -351,10 +351,9 @@ void WINAPI FreeMRUList (HANDLE hMRUList)
MRU_SaveChanged
(
mp
);
}
for
(
i
=
0
;
i
<
mp
->
extview
.
nMaxItems
;
i
++
)
{
if
(
mp
->
array
[
i
])
for
(
i
=
0
;
i
<
mp
->
extview
.
nMaxItems
;
i
++
)
Free
(
mp
->
array
[
i
]);
}
Free
(
mp
->
realMRU
);
Free
(
mp
->
array
);
Free
(
mp
->
extview
.
lpszSubKey
);
...
...
@@ -422,7 +421,6 @@ INT WINAPI FindMRUData (HANDLE hList, LPCVOID lpData, DWORD cbData,
}
}
}
if
(
dataA
)
Free
(
dataA
);
if
(
i
<
mp
->
cursize
)
ret
=
i
;
...
...
dlls/comctl32/header.c
View file @
8784d47c
...
...
@@ -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
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
)
{
if
(
mask
&
HDI_UNSUPPORTED_FIELDS
)
...
...
@@ -149,11 +141,8 @@ static void HEADER_StoreHDItemInHeader(HEADER_ITEM *lpItem, UINT mask, HDITEMW *
if
(
mask
&
HDI_TEXT
)
{
if
(
lpItem
->
pszText
)
{
Free
(
lpItem
->
pszText
);
lpItem
->
pszText
=
NULL
;
}
if
(
phdi
->
pszText
!=
LPSTR_TEXTCALLBACKW
)
/* covers != TEXTCALLBACKA too */
{
...
...
@@ -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
);
iOrder
=
infoPtr
->
items
[
iItem
].
iOrder
;
HEADER_DisposeItem
(
&
infoPtr
->
items
[
iItem
]
);
Free
(
infoPtr
->
items
[
iItem
].
pszText
);
infoPtr
->
uNumItem
--
;
memmove
(
&
infoPtr
->
items
[
iItem
],
&
infoPtr
->
items
[
iItem
+
1
],
...
...
@@ -1422,7 +1411,7 @@ HEADER_SetItemT (HWND hwnd, INT nItem, LPHDITEMW phdi, BOOL bUnicode)
HEADER_CopyHDItemForNotify
(
infoPtr
,
&
hdNotify
,
phdi
,
bUnicode
,
&
pvScratch
);
if
(
HEADER_SendNotifyWithHDItemT
(
hwnd
,
HDN_ITEMCHANGINGW
,
nItem
,
&
hdNotify
))
{
if
(
pvScratch
)
Free
(
pvScratch
);
Free
(
pvScratch
);
return
FALSE
;
}
...
...
@@ -1439,7 +1428,6 @@ HEADER_SetItemT (HWND hwnd, INT nItem, LPHDITEMW phdi, BOOL bUnicode)
InvalidateRect
(
hwnd
,
NULL
,
FALSE
);
if
(
pvScratch
!=
NULL
)
Free
(
pvScratch
);
return
TRUE
;
}
...
...
@@ -1517,12 +1505,11 @@ HEADER_NCDestroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
if
(
infoPtr
->
items
)
{
lpItem
=
infoPtr
->
items
;
for
(
nItem
=
0
;
nItem
<
infoPtr
->
uNumItem
;
nItem
++
,
lpItem
++
)
{
HEADER_DisposeItem
(
lpItem
);
Free
(
lpItem
->
pszText
);
}
Free
(
infoPtr
->
items
);
}
if
(
infoPtr
->
order
)
Free
(
infoPtr
->
order
);
if
(
infoPtr
->
himl
)
...
...
dlls/comctl32/listview.c
View file @
8784d47c
...
...
@@ -9964,8 +9964,7 @@ static LRESULT EditLblWndProcT(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPara
}
LISTVIEW_EndEditLabelT
(
infoPtr
,
buffer
,
isW
);
if
(
buffer
)
Free
(
buffer
);
Free
(
buffer
);
}
SendMessageW
(
hwnd
,
WM_CLOSE
,
0
,
0
);
...
...
dlls/comctl32/monthcal.c
View file @
8784d47c
...
...
@@ -1909,7 +1909,6 @@ static LRESULT
MONTHCAL_Destroy
(
MONTHCAL_INFO
*
infoPtr
)
{
/* free month calendar info data */
if
(
infoPtr
->
monthdayState
)
Free
(
infoPtr
->
monthdayState
);
SetWindowLongPtrW
(
infoPtr
->
hwndSelf
,
0
,
0
);
...
...
dlls/comctl32/propsheet.c
View file @
8784d47c
...
...
@@ -1494,7 +1494,6 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent,
ppshpage
->
pfnDlgProc
,
(
LPARAM
)
ppshpage
);
/* Free a no more needed copy */
if
(
temp
)
Free
(
temp
);
psInfo
->
proppage
[
index
].
hwndPage
=
hwndPage
;
...
...
dlls/comctl32/syslink.c
View file @
8784d47c
...
...
@@ -117,15 +117,9 @@ static VOID SYSLINK_FreeDocItem (PDOC_ITEM DocItem)
{
if
(
DocItem
->
Type
==
slLink
)
{
if
(
DocItem
->
u
.
Link
.
szID
!=
NULL
)
{
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
entire window text string */
...
...
@@ -1081,11 +1075,7 @@ static LRESULT SYSLINK_SetItem (SYSLINK_INFO *infoPtr, PLITEM Item)
}
else
{
if
(
szId
)
{
Free
(
szId
);
}
ERR
(
"Unable to allocate memory for link url
\n
"
);
return
FALSE
;
}
...
...
@@ -1093,19 +1083,13 @@ static LRESULT SYSLINK_SetItem (SYSLINK_INFO *infoPtr, PLITEM Item)
if
(
Item
->
mask
&
LIF_ITEMID
)
{
if
(
di
->
u
.
Link
.
szID
)
{
Free
(
di
->
u
.
Link
.
szID
);
}
di
->
u
.
Link
.
szID
=
szId
;
}
if
(
Item
->
mask
&
LIF_URL
)
{
if
(
di
->
u
.
Link
.
szUrl
)
{
Free
(
di
->
u
.
Link
.
szUrl
);
}
di
->
u
.
Link
.
szUrl
=
szUrl
;
}
...
...
dlls/comctl32/tab.c
View file @
8784d47c
...
...
@@ -2842,10 +2842,7 @@ static LRESULT TAB_DeleteItem (TAB_INFO *infoPtr, INT iItem)
LPBYTE
oldItems
=
(
LPBYTE
)
infoPtr
->
items
;
TAB_InvalidateTabArea
(
infoPtr
);
if
(
item
->
pszText
)
Free
(
item
->
pszText
);
infoPtr
->
uNumItem
--
;
if
(
!
infoPtr
->
uNumItem
)
...
...
dlls/comctl32/treeview.c
View file @
8784d47c
...
...
@@ -820,7 +820,6 @@ TREEVIEW_UpdateDispInfo(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
(
LPSTR
)
callback
.
item
.
pszText
,
-
1
,
wineItem
->
pszText
,
buflen
/
sizeof
(
WCHAR
));
wineItem
->
cchTextMax
=
buflen
/
sizeof
(
WCHAR
);
if
(
oldText
)
Free
(
oldText
);
}
}
...
...
@@ -1484,7 +1483,7 @@ TREEVIEW_RemoveItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem)
infoPtr
->
uNumItems
--
;
if
(
wineItem
->
pszText
&&
wineItem
->
pszText
!=
LPSTR_TEXTCALLBACKW
)
if
(
wineItem
->
pszText
!=
LPSTR_TEXTCALLBACKW
)
Free
(
wineItem
->
pszText
);
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