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
06395e5c
Commit
06395e5c
authored
Nov 28, 2022
by
Alex Henrie
Committed by
Alexandre Julliard
Nov 29, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Fix memory leak on realloc failure in Global_Split (cppcheck).
parent
cb4d61ef
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
global.c
dlls/vbscript/global.c
+5
-4
No files found.
dlls/vbscript/global.c
View file @
06395e5c
...
...
@@ -2574,7 +2574,7 @@ static HRESULT Global_Split(BuiltinDisp *This, VARIANT *args, unsigned args_cnt,
{
BSTR
str
,
string
,
delimiter
=
NULL
;
int
count
,
max
,
mode
,
len
,
start
,
end
,
ret
,
delimiterlen
=
1
;
int
i
,
*
indices
=
NULL
,
indices_max
=
8
;
int
i
,
*
indices
=
NULL
,
*
new_indices
,
indices_max
=
8
;
SAFEARRAYBOUND
bounds
;
SAFEARRAY
*
sa
=
NULL
;
VARIANT
*
data
,
var
;
...
...
@@ -2656,12 +2656,13 @@ static HRESULT Global_Split(BuiltinDisp *This, VARIANT *args, unsigned args_cnt,
}
if
(
count
==
indices_max
)
{
indices_max
*=
2
;
indices
=
realloc
(
indices
,
indices_max
*
sizeof
(
int
));
if
(
!
indices
)
{
new_indices
=
realloc
(
indices
,
indices_max
*
2
*
sizeof
(
int
));
if
(
!
new_indices
)
{
hres
=
E_OUTOFMEMORY
;
goto
error
;
}
indices
=
new_indices
;
indices_max
*=
2
;
}
indices
[
count
++
]
=
end
;
...
...
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