Commit 1548d0ef authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

jscript: Fixed a leak in do_regexp_match_next function.

parent 6c4f35f3
......@@ -3708,8 +3708,10 @@ static HRESULT RegExp_exec(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsig
TRACE("\n");
hres = run_exec(ctx, jsthis, argc ? argv[0] : jsval_string(jsstr_empty()), &string, &match, &parens, &parens_cnt, &b);
if(FAILED(hres))
if(FAILED(hres)) {
heap_free(parens);
return hres;
}
if(r) {
if(b) {
......@@ -3931,8 +3933,10 @@ HRESULT regexp_string_match(script_ctx_t *ctx, jsdisp_t *re, jsstr_t *str, jsval
const WCHAR *cp = str->str;
hres = regexp_match_next(ctx, &regexp->dispex, 0, str, &cp, &parens, &parens_size, &parens_cnt, &match);
if(FAILED(hres))
if(FAILED(hres)) {
heap_free(parens);
return hres;
}
if(r) {
if(hres == S_OK) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment