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
9dc584d0
Commit
9dc584d0
authored
Dec 31, 2009
by
Rob Shearman
Committed by
Alexandre Julliard
Dec 31, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Fix various memory and reference count leaks.
parent
e54b4602
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
34 additions
and
5 deletions
+34
-5
array.c
dlls/jscript/array.c
+3
-1
dispex.c
dlls/jscript/dispex.c
+2
-0
engine.c
dlls/jscript/engine.c
+20
-2
error.c
dlls/jscript/error.c
+1
-0
function.c
dlls/jscript/function.c
+1
-0
parser.y
dlls/jscript/parser.y
+1
-0
regexp.c
dlls/jscript/regexp.c
+4
-1
string.c
dlls/jscript/string.c
+2
-1
No files found.
dlls/jscript/array.c
View file @
9dc584d0
...
...
@@ -586,8 +586,10 @@ static HRESULT Array_slice(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DISPPA
if
(
hres
==
DISP_E_UNKNOWNNAME
)
continue
;
if
(
SUCCEEDED
(
hres
))
if
(
SUCCEEDED
(
hres
))
{
hres
=
jsdisp_propput_idx
(
arr
,
idx
-
start
,
&
v
,
ei
,
sp
);
VariantClear
(
&
v
);
}
if
(
FAILED
(
hres
))
{
jsdisp_release
(
arr
);
...
...
dlls/jscript/dispex.c
View file @
9dc584d0
...
...
@@ -473,6 +473,8 @@ static ULONG WINAPI DispatchEx_Release(IDispatchEx *iface)
}
heap_free
(
This
->
props
);
script_release
(
This
->
ctx
);
if
(
This
->
prototype
)
jsdisp_release
(
This
->
prototype
);
if
(
This
->
builtin_info
->
destructor
)
This
->
builtin_info
->
destructor
(
This
);
...
...
dlls/jscript/engine.c
View file @
9dc584d0
...
...
@@ -1412,11 +1412,15 @@ HRESULT array_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags,
exprval_release
(
&
exprval
);
}
if
(
SUCCEEDED
(
hres
))
if
(
SUCCEEDED
(
hres
))
{
hres
=
to_object
(
ctx
->
parser
->
script
,
&
member
,
&
obj
);
if
(
FAILED
(
hres
))
VariantClear
(
&
val
);
}
VariantClear
(
&
member
);
if
(
SUCCEEDED
(
hres
))
{
hres
=
to_string
(
ctx
->
parser
->
script
,
&
val
,
ei
,
&
str
);
VariantClear
(
&
val
);
if
(
SUCCEEDED
(
hres
))
{
if
(
flags
&
EXPR_STRREF
)
{
ret
->
type
=
EXPRVAL_NAMEREF
;
...
...
@@ -1426,6 +1430,7 @@ HRESULT array_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags,
}
hres
=
disp_get_id
(
ctx
->
parser
->
script
,
obj
,
str
,
flags
&
EXPR_NEWREF
?
fdexNameEnsure
:
0
,
&
id
);
SysFreeString
(
str
);
}
if
(
SUCCEEDED
(
hres
))
{
...
...
@@ -1569,6 +1574,7 @@ HRESULT new_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, j
hres
=
disp_call
(
ctx
->
parser
->
script
,
V_DISPATCH
(
&
constr
),
DISPID_VALUE
,
DISPATCH_CONSTRUCT
,
&
dp
,
&
var
,
ei
,
NULL
/*FIXME*/
);
IDispatch_Release
(
V_DISPATCH
(
&
constr
));
free_dp
(
&
dp
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -2490,6 +2496,7 @@ HRESULT plus_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags,
return
hres
;
hres
=
to_number
(
ctx
->
parser
->
script
,
&
val
,
ei
,
&
num
);
VariantClear
(
&
val
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -2749,6 +2756,8 @@ HRESULT equal_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags,
return
hres
;
hres
=
equal_values
(
ctx
,
&
rval
,
&
lval
,
ei
,
&
b
);
VariantClear
(
&
lval
);
VariantClear
(
&
rval
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -2770,6 +2779,8 @@ HRESULT equal2_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags
return
hres
;
hres
=
equal2_values
(
&
rval
,
&
lval
,
&
b
);
VariantClear
(
&
lval
);
VariantClear
(
&
rval
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -2791,6 +2802,8 @@ HRESULT not_equal_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD fl
return
hres
;
hres
=
equal_values
(
ctx
,
&
lval
,
&
rval
,
ei
,
&
b
);
VariantClear
(
&
lval
);
VariantClear
(
&
rval
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -2812,6 +2825,8 @@ HRESULT not_equal2_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD f
return
hres
;
hres
=
equal2_values
(
&
lval
,
&
rval
,
&
b
);
VariantClear
(
&
lval
);
VariantClear
(
&
rval
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
@@ -3114,8 +3129,11 @@ HRESULT assign_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags
exprval_release
(
&
exprvalr
);
}
if
(
SUCCEEDED
(
hres
))
if
(
SUCCEEDED
(
hres
))
{
hres
=
put_value
(
ctx
->
parser
->
script
,
&
exprval
,
&
rval
,
ei
);
if
(
FAILED
(
hres
))
VariantClear
(
&
rval
);
}
exprval_release
(
&
exprval
);
if
(
FAILED
(
hres
))
...
...
dlls/jscript/error.c
View file @
9dc584d0
...
...
@@ -330,6 +330,7 @@ static HRESULT error_constr(script_ctx_t *ctx, WORD flags, DISPPARAMS *dp,
hres
=
create_error
(
ctx
,
constr
,
NULL
,
msg
,
&
err
);
else
hres
=
create_error
(
ctx
,
constr
,
&
num
,
msg
,
&
err
);
SysFreeString
(
msg
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/jscript/function.c
View file @
9dc584d0
...
...
@@ -213,6 +213,7 @@ static HRESULT invoke_source(script_ctx_t *ctx, FunctionInstance *function, IDis
hres
=
create_exec_ctx
(
ctx
,
this_obj
,
var_disp
,
scope
,
&
exec_ctx
);
scope_release
(
scope
);
}
jsdisp_release
(
var_disp
);
if
(
FAILED
(
hres
))
return
hres
;
...
...
dlls/jscript/parser.y
View file @
9dc584d0
...
...
@@ -1583,6 +1583,7 @@ void parser_release(parser_ctx_t *ctx)
if(--ctx->ref)
return;
script_release(ctx->script);
heap_free(ctx->begin);
jsheap_free(&ctx->heap);
heap_free(ctx);
...
...
dlls/jscript/regexp.c
View file @
9dc584d0
...
...
@@ -3667,8 +3667,11 @@ static HRESULT run_exec(script_ctx_t *ctx, vdisp_t *jsthis, VARIANT *arg, jsexce
*
ret
=
VARIANT_FALSE
;
}
if
(
input
)
if
(
input
)
{
*
input
=
string
;
}
else
{
SysFreeString
(
string
);
}
return
S_OK
;
}
...
...
dlls/jscript/string.c
View file @
9dc584d0
...
...
@@ -703,6 +703,7 @@ static HRESULT String_match(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISP
break
;
}
heap_free
(
match_result
);
SysFreeString
(
val_str
);
if
(
SUCCEEDED
(
hres
)
&&
retv
)
{
...
...
@@ -795,7 +796,7 @@ static HRESULT rep_call(script_ctx_t *ctx, DispatchEx *func, const WCHAR *str, m
if
(
SUCCEEDED
(
hres
))
hres
=
jsdisp_call_value
(
func
,
DISPATCH_METHOD
,
&
dp
,
&
var
,
ei
,
caller
);
for
(
i
=
0
;
i
<
parens_cnt
+
1
;
i
++
)
{
for
(
i
=
0
;
i
<
parens_cnt
+
3
;
i
++
)
{
if
(
i
!=
parens_cnt
+
1
)
SysFreeString
(
V_BSTR
(
get_arg
(
&
dp
,
i
)));
}
...
...
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