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
a6847dd9
Commit
a6847dd9
authored
Feb 08, 2023
by
Jason Millard
Committed by
Alexandre Julliard
Feb 08, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vbscript: Fix memory leak in Split().
parent
f8b76d3d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
+14
-7
interp.c
dlls/vbscript/interp.c
+14
-7
No files found.
dlls/vbscript/interp.c
View file @
a6847dd9
...
...
@@ -1375,24 +1375,31 @@ static HRESULT interp_redim_preserve(exec_ctx_t *ctx)
if
(
array
==
NULL
||
array
->
cDims
==
0
)
{
/* can initially allocate the array */
array
=
SafeArrayCreate
(
VT_VARIANT
,
dim_cnt
,
bounds
);
VariantClear
(
v
);
V_VT
(
v
)
=
VT_ARRAY
|
VT_VARIANT
;
V_ARRAY
(
v
)
=
array
;
return
S_OK
;
if
(
!
array
)
hres
=
E_OUTOFMEMORY
;
else
{
VariantClear
(
v
);
V_VT
(
v
)
=
VT_ARRAY
|
VT_VARIANT
;
V_ARRAY
(
v
)
=
array
;
}
}
else
if
(
array
->
cDims
!=
dim_cnt
)
{
/* can't otherwise change the number of dimensions */
TRACE
(
"Can't resize %s, cDims %d != %d
\n
"
,
debugstr_w
(
identifier
),
array
->
cDims
,
dim_cnt
);
return
MAKE_VBSERROR
(
VBSE_OUT_OF_BOUNDS
);
hres
=
MAKE_VBSERROR
(
VBSE_OUT_OF_BOUNDS
);
}
else
{
/* can resize the last dimensions (if others match */
for
(
i
=
0
;
i
+
1
<
dim_cnt
;
++
i
)
{
if
(
array
->
rgsabound
[
array
->
cDims
-
1
-
i
].
cElements
!=
bounds
[
i
].
cElements
)
{
TRACE
(
"Can't resize %s, bound[%d] %ld != %ld
\n
"
,
debugstr_w
(
identifier
),
i
,
array
->
rgsabound
[
i
].
cElements
,
bounds
[
i
].
cElements
);
return
MAKE_VBSERROR
(
VBSE_OUT_OF_BOUNDS
);
hres
=
MAKE_VBSERROR
(
VBSE_OUT_OF_BOUNDS
);
break
;
}
}
return
SafeArrayRedim
(
array
,
&
bounds
[
dim_cnt
-
1
]);
if
(
SUCCEEDED
(
hres
))
hres
=
SafeArrayRedim
(
array
,
&
bounds
[
dim_cnt
-
1
]);
}
free
(
bounds
);
return
hres
;
}
static
HRESULT
interp_step
(
exec_ctx_t
*
ctx
)
...
...
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