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
d394df4a
Commit
d394df4a
authored
Dec 11, 2022
by
Alex Henrie
Committed by
Alexandre Julliard
Jan 24, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Fix memory leak on realloc failure in search_directory (cppcheck).
parent
6c1dd0f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
appsearch.c
dlls/msi/appsearch.c
+10
-3
No files found.
dlls/msi/appsearch.c
View file @
d394df4a
...
...
@@ -875,7 +875,7 @@ static UINT search_directory( MSIPACKAGE *package, MSISIGNATURE *sig, const WCHA
{
UINT
rc
;
DWORD
attr
;
LPWSTR
val
=
NULL
;
WCHAR
*
val
=
NULL
,
*
new_val
;
TRACE
(
"%p, %p, %s, %d, %p
\n
"
,
package
,
sig
,
debugstr_w
(
path
),
depth
,
appValue
);
...
...
@@ -920,11 +920,18 @@ static UINT search_directory( MSIPACKAGE *package, MSISIGNATURE *sig, const WCHA
if
(
attr
!=
INVALID_FILE_ATTRIBUTES
&&
(
attr
&
FILE_ATTRIBUTE_DIRECTORY
)
&&
val
&&
val
[
lstrlenW
(
val
)
-
1
]
!=
'\\'
)
{
val
=
realloc
(
val
,
(
wcslen
(
val
)
+
2
)
*
sizeof
(
WCHAR
));
if
(
!
val
)
new_val
=
realloc
(
val
,
(
wcslen
(
val
)
+
2
)
*
sizeof
(
WCHAR
));
if
(
!
new_val
)
{
free
(
val
);
val
=
NULL
;
rc
=
ERROR_OUTOFMEMORY
;
}
else
{
val
=
new_val
;
PathAddBackslashW
(
val
);
}
}
*
appValue
=
val
;
...
...
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