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
e7ba00c7
Commit
e7ba00c7
authored
Nov 28, 2022
by
Alex Henrie
Committed by
Alexandre Julliard
Feb 01, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
appwiz: Fix memory leak on realloc failure in install_from_registered_dir (cppcheck).
parent
9c5e380c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
addons.c
dlls/appwiz.cpl/addons.c
+5
-2
No files found.
dlls/appwiz.cpl/addons.c
View file @
e7ba00c7
...
...
@@ -255,7 +255,7 @@ static HKEY open_config_key(void)
static
enum
install_res
install_from_registered_dir
(
void
)
{
char
*
package_dir
;
char
*
package_dir
,
*
new_package_dir
;
HKEY
hkey
;
DWORD
res
,
type
,
size
=
MAX_PATH
;
enum
install_res
ret
;
...
...
@@ -267,9 +267,12 @@ static enum install_res install_from_registered_dir(void)
package_dir
=
malloc
(
size
);
res
=
RegGetValueA
(
hkey
,
NULL
,
addon
->
dir_config_key
,
RRF_RT_ANY
,
&
type
,
(
PBYTE
)
package_dir
,
&
size
);
if
(
res
==
ERROR_MORE_DATA
)
{
package_dir
=
realloc
(
package_dir
,
size
);
new_package_dir
=
realloc
(
package_dir
,
size
);
if
(
new_package_dir
)
{
package_dir
=
new_package_dir
;
res
=
RegGetValueA
(
hkey
,
NULL
,
addon
->
dir_config_key
,
RRF_RT_ANY
,
&
type
,
(
PBYTE
)
package_dir
,
&
size
);
}
}
RegCloseKey
(
hkey
);
if
(
res
==
ERROR_FILE_NOT_FOUND
)
{
free
(
package_dir
);
...
...
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