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
22ecd7aa
Commit
22ecd7aa
authored
Mar 07, 2007
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Mar 08, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Remove redundant NULL checks before Free() (found by Smatch).
parent
bb9dea6b
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
34 additions
and
56 deletions
+34
-56
comboex.c
dlls/comctl32/comboex.c
+2
-4
comctl32undoc.c
dlls/comctl32/comctl32undoc.c
+4
-8
header.c
dlls/comctl32/header.c
+2
-2
propsheet.c
dlls/comctl32/propsheet.c
+2
-2
rebar.c
dlls/comctl32/rebar.c
+2
-4
status.c
dlls/comctl32/status.c
+9
-12
string.c
dlls/comctl32/string.c
+4
-8
syslink.c
dlls/comctl32/syslink.c
+5
-8
tab.c
dlls/comctl32/tab.c
+2
-5
toolbar.c
dlls/comctl32/toolbar.c
+1
-2
updown.c
dlls/comctl32/updown.c
+1
-1
No files found.
dlls/comctl32/comboex.c
View file @
22ecd7aa
...
@@ -1580,10 +1580,8 @@ static LRESULT COMBOEX_Destroy (COMBOEX_INFO *infoPtr)
...
@@ -1580,10 +1580,8 @@ static LRESULT COMBOEX_Destroy (COMBOEX_INFO *infoPtr)
if
(
infoPtr
->
hwndCombo
)
if
(
infoPtr
->
hwndCombo
)
DestroyWindow
(
infoPtr
->
hwndCombo
);
DestroyWindow
(
infoPtr
->
hwndCombo
);
if
(
infoPtr
->
edit
)
{
Free
(
infoPtr
->
edit
);
Free
(
infoPtr
->
edit
);
infoPtr
->
edit
=
0
;
infoPtr
->
edit
=
0
;
}
if
(
infoPtr
->
items
)
{
if
(
infoPtr
->
items
)
{
CBE_ITEMDATA
*
item
,
*
next
;
CBE_ITEMDATA
*
item
,
*
next
;
...
...
dlls/comctl32/comctl32undoc.c
View file @
22ecd7aa
...
@@ -954,10 +954,8 @@ BOOL Str_SetPtrAtoW (LPWSTR *lppDest, LPCSTR lpSrc)
...
@@ -954,10 +954,8 @@ BOOL Str_SetPtrAtoW (LPWSTR *lppDest, LPCSTR lpSrc)
*
lppDest
=
ptr
;
*
lppDest
=
ptr
;
}
}
else
{
else
{
if
(
*
lppDest
)
{
Free
(
*
lppDest
);
Free
(
*
lppDest
);
*
lppDest
=
NULL
;
*
lppDest
=
NULL
;
}
}
}
return
TRUE
;
return
TRUE
;
...
@@ -994,10 +992,8 @@ BOOL Str_SetPtrWtoA (LPSTR *lppDest, LPCWSTR lpSrc)
...
@@ -994,10 +992,8 @@ BOOL Str_SetPtrWtoA (LPSTR *lppDest, LPCWSTR lpSrc)
*
lppDest
=
ptr
;
*
lppDest
=
ptr
;
}
}
else
{
else
{
if
(
*
lppDest
)
{
Free
(
*
lppDest
);
Free
(
*
lppDest
);
*
lppDest
=
NULL
;
*
lppDest
=
NULL
;
}
}
}
return
TRUE
;
return
TRUE
;
...
...
dlls/comctl32/header.c
View file @
22ecd7aa
...
@@ -957,12 +957,12 @@ HEADER_PrepareCallbackItems(HWND hwnd, INT iItem, INT reqMask)
...
@@ -957,12 +957,12 @@ HEADER_PrepareCallbackItems(HWND hwnd, INT iItem, INT reqMask)
static
void
static
void
HEADER_FreeCallbackItems
(
HEADER_ITEM
*
lpItem
)
HEADER_FreeCallbackItems
(
HEADER_ITEM
*
lpItem
)
{
{
if
(
lpItem
->
callbackMask
&
HDI_TEXT
&&
lpItem
->
pszText
!=
NULL
)
if
(
lpItem
->
callbackMask
&
HDI_TEXT
)
{
{
Free
(
lpItem
->
pszText
);
Free
(
lpItem
->
pszText
);
lpItem
->
pszText
=
NULL
;
lpItem
->
pszText
=
NULL
;
}
}
if
(
lpItem
->
callbackMask
&
HDI_IMAGE
)
if
(
lpItem
->
callbackMask
&
HDI_IMAGE
)
lpItem
->
iImage
=
I_IMAGECALLBACK
;
lpItem
->
iImage
=
I_IMAGECALLBACK
;
}
}
...
...
dlls/comctl32/propsheet.c
View file @
22ecd7aa
...
@@ -2404,7 +2404,7 @@ static BOOL PROPSHEET_RemovePage(HWND hwndDlg,
...
@@ -2404,7 +2404,7 @@ static BOOL PROPSHEET_RemovePage(HWND hwndDlg,
{
{
PROPSHEETPAGEW
*
psp
=
(
PROPSHEETPAGEW
*
)
psInfo
->
proppage
[
index
].
hpage
;
PROPSHEETPAGEW
*
psp
=
(
PROPSHEETPAGEW
*
)
psInfo
->
proppage
[
index
].
hpage
;
if
(
(
psp
->
dwFlags
&
PSP_USETITLE
)
&&
psInfo
->
proppage
[
index
].
pszText
)
if
(
psp
->
dwFlags
&
PSP_USETITLE
)
Free
((
LPVOID
)
psInfo
->
proppage
[
index
].
pszText
);
Free
((
LPVOID
)
psInfo
->
proppage
[
index
].
pszText
);
DestroyPropertySheetPage
(
psInfo
->
proppage
[
index
].
hpage
);
DestroyPropertySheetPage
(
psInfo
->
proppage
[
index
].
hpage
);
...
@@ -2719,7 +2719,7 @@ static void PROPSHEET_CleanUp(HWND hwndDlg)
...
@@ -2719,7 +2719,7 @@ static void PROPSHEET_CleanUp(HWND hwndDlg)
if
(
psp
)
if
(
psp
)
{
{
if
(
(
psp
->
dwFlags
&
PSP_USETITLE
)
&&
psInfo
->
proppage
[
i
].
pszText
)
if
(
psp
->
dwFlags
&
PSP_USETITLE
)
Free
((
LPVOID
)
psInfo
->
proppage
[
i
].
pszText
);
Free
((
LPVOID
)
psInfo
->
proppage
[
i
].
pszText
);
DestroyPropertySheetPage
(
psInfo
->
proppage
[
i
].
hpage
);
DestroyPropertySheetPage
(
psInfo
->
proppage
[
i
].
hpage
);
...
...
dlls/comctl32/rebar.c
View file @
22ecd7aa
...
@@ -2750,10 +2750,8 @@ REBAR_Destroy (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
...
@@ -2750,10 +2750,8 @@ REBAR_Destroy (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
lpBand
=
&
infoPtr
->
bands
[
i
];
lpBand
=
&
infoPtr
->
bands
[
i
];
/* delete text strings */
/* delete text strings */
if
(
lpBand
->
lpText
)
{
Free
(
lpBand
->
lpText
);
Free
(
lpBand
->
lpText
);
lpBand
->
lpText
=
NULL
;
lpBand
->
lpText
=
NULL
;
}
/* destroy child window */
/* destroy child window */
DestroyWindow
(
lpBand
->
hwndChild
);
DestroyWindow
(
lpBand
->
hwndChild
);
}
}
...
...
dlls/comctl32/status.c
View file @
22ecd7aa
...
@@ -662,7 +662,7 @@ STATUSBAR_SetParts (STATUS_INFO *infoPtr, INT count, LPINT parts)
...
@@ -662,7 +662,7 @@ STATUSBAR_SetParts (STATUS_INFO *infoPtr, INT count, LPINT parts)
infoPtr
->
numParts
=
count
;
infoPtr
->
numParts
=
count
;
if
(
oldNumParts
>
infoPtr
->
numParts
)
{
if
(
oldNumParts
>
infoPtr
->
numParts
)
{
for
(
i
=
infoPtr
->
numParts
;
i
<
oldNumParts
;
i
++
)
{
for
(
i
=
infoPtr
->
numParts
;
i
<
oldNumParts
;
i
++
)
{
if
(
infoPtr
->
parts
[
i
].
text
&&
!
(
infoPtr
->
parts
[
i
].
style
&
SBT_OWNERDRAW
))
if
(
!
(
infoPtr
->
parts
[
i
].
style
&
SBT_OWNERDRAW
))
Free
(
infoPtr
->
parts
[
i
].
text
);
Free
(
infoPtr
->
parts
[
i
].
text
);
}
}
}
else
if
(
oldNumParts
<
infoPtr
->
numParts
)
{
}
else
if
(
oldNumParts
<
infoPtr
->
numParts
)
{
...
@@ -671,8 +671,7 @@ STATUSBAR_SetParts (STATUS_INFO *infoPtr, INT count, LPINT parts)
...
@@ -671,8 +671,7 @@ STATUSBAR_SetParts (STATUS_INFO *infoPtr, INT count, LPINT parts)
for
(
i
=
0
;
i
<
oldNumParts
;
i
++
)
{
for
(
i
=
0
;
i
<
oldNumParts
;
i
++
)
{
tmp
[
i
]
=
infoPtr
->
parts
[
i
];
tmp
[
i
]
=
infoPtr
->
parts
[
i
];
}
}
if
(
infoPtr
->
parts
)
Free
(
infoPtr
->
parts
);
Free
(
infoPtr
->
parts
);
infoPtr
->
parts
=
tmp
;
infoPtr
->
parts
=
tmp
;
}
}
if
(
oldNumParts
==
infoPtr
->
numParts
)
{
if
(
oldNumParts
==
infoPtr
->
numParts
)
{
...
@@ -751,10 +750,9 @@ STATUSBAR_SetTextT (STATUS_INFO *infoPtr, INT nPart, WORD style,
...
@@ -751,10 +750,9 @@ STATUSBAR_SetTextT (STATUS_INFO *infoPtr, INT nPart, WORD style,
oldStyle
=
part
->
style
;
oldStyle
=
part
->
style
;
part
->
style
=
style
;
part
->
style
=
style
;
if
(
style
&
SBT_OWNERDRAW
)
{
if
(
style
&
SBT_OWNERDRAW
)
{
if
(
!
(
oldStyle
&
SBT_OWNERDRAW
))
{
if
(
!
(
oldStyle
&
SBT_OWNERDRAW
))
if
(
part
->
text
)
Free
(
part
->
text
);
Free
(
part
->
text
);
else
if
(
part
->
text
==
text
)
}
else
if
(
part
->
text
==
text
)
return
TRUE
;
return
TRUE
;
part
->
text
=
(
LPWSTR
)
text
;
part
->
text
=
(
LPWSTR
)
text
;
}
else
{
}
else
{
...
@@ -783,7 +781,7 @@ STATUSBAR_SetTextT (STATUS_INFO *infoPtr, INT nPart, WORD style,
...
@@ -783,7 +781,7 @@ STATUSBAR_SetTextT (STATUS_INFO *infoPtr, INT nPart, WORD style,
return
TRUE
;
return
TRUE
;
}
}
if
(
part
->
text
&&
!
(
oldStyle
&
SBT_OWNERDRAW
))
if
(
!
(
oldStyle
&
SBT_OWNERDRAW
))
Free
(
part
->
text
);
Free
(
part
->
text
);
part
->
text
=
ntext
;
part
->
text
=
ntext
;
}
}
...
@@ -870,10 +868,10 @@ STATUSBAR_WMDestroy (STATUS_INFO *infoPtr)
...
@@ -870,10 +868,10 @@ STATUSBAR_WMDestroy (STATUS_INFO *infoPtr)
TRACE
(
"
\n
"
);
TRACE
(
"
\n
"
);
for
(
i
=
0
;
i
<
infoPtr
->
numParts
;
i
++
)
{
for
(
i
=
0
;
i
<
infoPtr
->
numParts
;
i
++
)
{
if
(
infoPtr
->
parts
[
i
].
text
&&
!
(
infoPtr
->
parts
[
i
].
style
&
SBT_OWNERDRAW
))
if
(
!
(
infoPtr
->
parts
[
i
].
style
&
SBT_OWNERDRAW
))
Free
(
infoPtr
->
parts
[
i
].
text
);
Free
(
infoPtr
->
parts
[
i
].
text
);
}
}
if
(
infoPtr
->
part0
.
text
&&
!
(
infoPtr
->
part0
.
style
&
SBT_OWNERDRAW
))
if
(
!
(
infoPtr
->
part0
.
style
&
SBT_OWNERDRAW
))
Free
(
infoPtr
->
part0
.
text
);
Free
(
infoPtr
->
part0
.
text
);
Free
(
infoPtr
->
parts
);
Free
(
infoPtr
->
parts
);
...
@@ -1138,8 +1136,7 @@ STATUSBAR_WMSetText (STATUS_INFO *infoPtr, LPCSTR text)
...
@@ -1138,8 +1136,7 @@ STATUSBAR_WMSetText (STATUS_INFO *infoPtr, LPCSTR text)
part
=
&
infoPtr
->
parts
[
0
];
part
=
&
infoPtr
->
parts
[
0
];
/* duplicate string */
/* duplicate string */
if
(
part
->
text
)
Free
(
part
->
text
);
Free
(
part
->
text
);
part
->
text
=
0
;
part
->
text
=
0
;
if
(
infoPtr
->
bUnicode
)
{
if
(
infoPtr
->
bUnicode
)
{
if
(
text
&&
(
len
=
strlenW
((
LPCWSTR
)
text
)))
{
if
(
text
&&
(
len
=
strlenW
((
LPCWSTR
)
text
)))
{
...
...
dlls/comctl32/string.c
View file @
22ecd7aa
...
@@ -215,10 +215,8 @@ BOOL WINAPI Str_SetPtrA (LPSTR *lppDest, LPCSTR lpSrc)
...
@@ -215,10 +215,8 @@ BOOL WINAPI Str_SetPtrA (LPSTR *lppDest, LPCSTR lpSrc)
*
lppDest
=
ptr
;
*
lppDest
=
ptr
;
}
}
else
{
else
{
if
(
*
lppDest
)
{
Free
(
*
lppDest
);
Free
(
*
lppDest
);
*
lppDest
=
NULL
;
*
lppDest
=
NULL
;
}
}
}
return
TRUE
;
return
TRUE
;
...
@@ -274,10 +272,8 @@ BOOL WINAPI Str_SetPtrW (LPWSTR *lppDest, LPCWSTR lpSrc)
...
@@ -274,10 +272,8 @@ BOOL WINAPI Str_SetPtrW (LPWSTR *lppDest, LPCWSTR lpSrc)
*
lppDest
=
ptr
;
*
lppDest
=
ptr
;
}
}
else
{
else
{
if
(
*
lppDest
)
{
Free
(
*
lppDest
);
Free
(
*
lppDest
);
*
lppDest
=
NULL
;
*
lppDest
=
NULL
;
}
}
}
return
TRUE
;
return
TRUE
;
...
...
dlls/comctl32/syslink.c
View file @
22ecd7aa
...
@@ -675,23 +675,20 @@ static VOID SYSLINK_Render (SYSLINK_INFO *infoPtr, HDC hdc, PRECT pRect)
...
@@ -675,23 +675,20 @@ static VOID SYSLINK_Render (SYSLINK_INFO *infoPtr, HDC hdc, PRECT pRect)
PDOC_TEXTBLOCK
bl
,
cbl
;
PDOC_TEXTBLOCK
bl
,
cbl
;
INT
nFit
;
INT
nFit
;
SIZE
szDim
;
SIZE
szDim
;
if
(
Current
->
nText
==
0
)
if
(
Current
->
nText
==
0
)
{
{
continue
;
continue
;
}
}
tx
=
Current
->
Text
;
tx
=
Current
->
Text
;
n
=
Current
->
nText
;
n
=
Current
->
nText
;
if
(
Current
->
Blocks
!=
NULL
)
Free
(
Current
->
Blocks
);
{
Current
->
Blocks
=
NULL
;
Free
(
Current
->
Blocks
);
Current
->
Blocks
=
NULL
;
}
bl
=
NULL
;
bl
=
NULL
;
nBlocks
=
0
;
nBlocks
=
0
;
if
(
Current
->
Type
==
slText
)
if
(
Current
->
Type
==
slText
)
{
{
SelectObject
(
hdc
,
infoPtr
->
Font
);
SelectObject
(
hdc
,
infoPtr
->
Font
);
...
...
dlls/comctl32/tab.c
View file @
22ecd7aa
...
@@ -2768,11 +2768,8 @@ TAB_SetItemT (TAB_INFO *infoPtr, INT iItem, LPTCITEMW tabItem, BOOL bUnicode)
...
@@ -2768,11 +2768,8 @@ TAB_SetItemT (TAB_INFO *infoPtr, INT iItem, LPTCITEMW tabItem, BOOL bUnicode)
if
(
tabItem
->
mask
&
TCIF_TEXT
)
if
(
tabItem
->
mask
&
TCIF_TEXT
)
{
{
if
(
wineItem
->
pszText
)
Free
(
wineItem
->
pszText
);
{
wineItem
->
pszText
=
NULL
;
Free
(
wineItem
->
pszText
);
wineItem
->
pszText
=
NULL
;
}
if
(
bUnicode
)
if
(
bUnicode
)
Str_SetPtrW
(
&
wineItem
->
pszText
,
tabItem
->
pszText
);
Str_SetPtrW
(
&
wineItem
->
pszText
,
tabItem
->
pszText
);
else
else
...
...
dlls/comctl32/toolbar.c
View file @
22ecd7aa
...
@@ -5385,8 +5385,7 @@ TOOLBAR_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
...
@@ -5385,8 +5385,7 @@ TOOLBAR_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
Free
(
infoPtr
->
bitmaps
);
/* bitmaps list */
Free
(
infoPtr
->
bitmaps
);
/* bitmaps list */
/* delete button data */
/* delete button data */
if
(
infoPtr
->
buttons
)
Free
(
infoPtr
->
buttons
);
Free
(
infoPtr
->
buttons
);
/* delete strings */
/* delete strings */
if
(
infoPtr
->
strings
)
{
if
(
infoPtr
->
strings
)
{
...
...
dlls/comctl32/updown.c
View file @
22ecd7aa
...
@@ -831,7 +831,7 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L
...
@@ -831,7 +831,7 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L
break
;
break
;
case
WM_DESTROY
:
case
WM_DESTROY
:
if
(
infoPtr
->
AccelVect
)
Free
(
infoPtr
->
AccelVect
);
Free
(
infoPtr
->
AccelVect
);
if
(
infoPtr
->
Buddy
)
RemovePropW
(
infoPtr
->
Buddy
,
BUDDY_UPDOWN_HWND
);
if
(
infoPtr
->
Buddy
)
RemovePropW
(
infoPtr
->
Buddy
,
BUDDY_UPDOWN_HWND
);
...
...
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