jscript: Fixed a leak in do_regexp_match_next function.

This commit is contained in:
Piotr Caban 2013-01-25 16:47:57 +01:00 committed by Alexandre Julliard
parent 6c4f35f345
commit 1548d0ef7b
1 changed files with 6 additions and 2 deletions

View File

@ -3708,8 +3708,10 @@ static HRESULT RegExp_exec(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsig
TRACE("\n"); TRACE("\n");
hres = run_exec(ctx, jsthis, argc ? argv[0] : jsval_string(jsstr_empty()), &string, &match, &parens, &parens_cnt, &b); 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; return hres;
}
if(r) { if(r) {
if(b) { 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; const WCHAR *cp = str->str;
hres = regexp_match_next(ctx, &regexp->dispex, 0, str, &cp, &parens, &parens_size, &parens_cnt, &match); 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; return hres;
}
if(r) { if(r) {
if(hres == S_OK) { if(hres == S_OK) {