Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
ecc850c4
Commit
ecc850c4
authored
Mar 25, 2005
by
Dimitrie O. Paun
Committed by
Alexandre Julliard
Mar 25, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a memory leak in toolbar. Avoid casts.
parent
1ef206de
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
+18
-8
toolbar.c
dlls/comctl32/toolbar.c
+18
-8
No files found.
dlls/comctl32/toolbar.c
View file @
ecc850c4
...
...
@@ -4527,23 +4527,33 @@ TOOLBAR_SaveRestoreW (HWND hwnd, WPARAM wParam, LPTBSAVEPARAMSW lpSave)
static
LRESULT
TOOLBAR_SaveRestoreA
(
HWND
hwnd
,
WPARAM
wParam
,
LPTBSAVEPARAMSA
lpSave
)
{
LPWSTR
pszValueName
=
0
,
pszSubKey
=
0
;
TBSAVEPARAMSW
SaveW
;
LRESULT
result
=
0
;
int
len
;
if
(
lpSave
==
NULL
)
return
0
;
SaveW
.
hkr
=
lpSave
->
hkr
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lpSave
->
pszSubKey
,
-
1
,
NULL
,
0
);
SaveW
.
pszSubKey
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
lpSave
->
pszSubKey
,
-
1
,
(
LPWSTR
)
SaveW
.
pszSubKey
,
len
);
pszSubKey
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
if
(
pszSubKey
)
goto
exit
;
MultiByteToWideChar
(
CP_ACP
,
0
,
lpSave
->
pszSubKey
,
-
1
,
pszSubKey
,
len
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
lpSave
->
pszValueName
,
-
1
,
NULL
,
0
);
SaveW
.
pszValueName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
lpSave
->
pszValueName
,
-
1
,
(
LPWSTR
)
SaveW
.
pszValueName
,
len
);
pszValueName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
if
(
!
pszValueName
)
goto
exit
;
MultiByteToWideChar
(
CP_ACP
,
0
,
lpSave
->
pszValueName
,
-
1
,
pszValueName
,
len
);
SaveW
.
pszValueName
=
pszValueName
;
SaveW
.
pszSubKey
=
pszSubKey
;
SaveW
.
hkr
=
lpSave
->
hkr
;
result
=
TOOLBAR_SaveRestoreW
(
hwnd
,
wParam
,
&
SaveW
);
exit:
HeapFree
(
GetProcessHeap
(),
0
,
pszValueName
);
HeapFree
(
GetProcessHeap
(),
0
,
pszSubKey
);
/* FIXME: shoudn't we free the HeapAlloc()ed memory? */
return
TOOLBAR_SaveRestoreW
(
hwnd
,
wParam
,
&
SaveW
);
return
result
;
}
...
...
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