Piotr Caban : jscript: Fixed a leak in do_regexp_match_next function.
Alexandre Julliard
julliard at winehq.org
Fri Jan 25 13:31:49 CST 2013
Module: wine
Branch: master
Commit: 1548d0ef7b9a029fc35cb58cba3abb2906ea7894
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1548d0ef7b9a029fc35cb58cba3abb2906ea7894
Author: Piotr Caban <piotr at codeweavers.com>
Date: Fri Jan 25 16:47:57 2013 +0100
jscript: Fixed a leak in do_regexp_match_next function.
---
dlls/jscript/regexp.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/jscript/regexp.c b/dlls/jscript/regexp.c
index 4d29390..a06550d 100644
--- a/dlls/jscript/regexp.c
+++ b/dlls/jscript/regexp.c
@@ -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, ®exp->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) {
More information about the wine-cvs
mailing list