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
f8b76d3d
Commit
f8b76d3d
authored
Feb 08, 2023
by
Jason Millard
Committed by
Alexandre Julliard
Feb 08, 2023
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Fix memory leak in Split().
parent
da403f0b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
12 deletions
+6
-12
global.c
dlls/vbscript/global.c
+6
-12
No files found.
dlls/vbscript/global.c
View file @
f8b76d3d
...
...
@@ -2578,12 +2578,12 @@ static HRESULT Global_Join(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, V
static
HRESULT
Global_Split
(
BuiltinDisp
*
This
,
VARIANT
*
args
,
unsigned
args_cnt
,
VARIANT
*
res
)
{
BSTR
str
,
str
ing
,
delimiter
=
NULL
;
BSTR
string
,
delimiter
=
NULL
;
int
count
,
max
,
mode
,
len
,
start
,
end
,
ret
,
delimiterlen
=
1
;
int
i
,
*
indices
=
NULL
,
*
new_indices
,
indices_max
=
8
;
SAFEARRAYBOUND
bounds
;
SAFEARRAY
*
sa
=
NULL
;
VARIANT
*
data
,
var
;
VARIANT
*
data
;
HRESULT
hres
=
S_OK
;
TRACE
(
"%s %u...
\n
"
,
debugstr_variant
(
args
),
args_cnt
);
...
...
@@ -2691,19 +2691,13 @@ static HRESULT Global_Split(BuiltinDisp *This, VARIANT *args, unsigned args_cnt,
start
=
0
;
for
(
i
=
0
;
i
<
count
;
i
++
)
{
str
=
SysAllocStringLen
(
string
+
start
,
indices
[
i
]
-
start
);
if
(
!
str
)
{
V_VT
(
&
data
[
i
])
=
VT_BSTR
;
V_BSTR
(
&
data
[
i
])
=
SysAllocStringLen
(
string
+
start
,
indices
[
i
]
-
start
);
if
(
!
V_BSTR
(
&
data
[
i
]))
{
hres
=
E_OUTOFMEMORY
;
break
;
}
V_VT
(
&
var
)
=
VT_BSTR
;
V_BSTR
(
&
var
)
=
str
;
hres
=
VariantCopyInd
(
data
+
i
,
&
var
);
if
(
FAILED
(
hres
))
{
SafeArrayUnaccessData
(
sa
);
goto
error
;
}
start
=
indices
[
i
]
+
delimiterlen
;
}
SafeArrayUnaccessData
(
sa
);
...
...
Vitaly Lipatov
@lav
mentioned in commit
53d7327c
·
Feb 25, 2024
mentioned in commit
53d7327c
mentioned in commit 53d7327c047a9e05eb736111989592f1bd792d46
Toggle commit list
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