jscript: Don't release possible NULL pointer (coverity)

André Hentschel nerv at dawncrow.de
Wed Oct 17 17:14:48 CDT 2012


CID 735258

---
 dlls/jscript/regexp.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/dlls/jscript/regexp.c b/dlls/jscript/regexp.c
index bdff445..71474c7 100644
--- a/dlls/jscript/regexp.c
+++ b/dlls/jscript/regexp.c
@@ -3378,7 +3378,9 @@ static HRESULT do_regexp_match_next(script_ctx_t *ctx, RegExpInstance *regexp, D
         last_match = jsstr_alloc_len(str, len);
         if(!last_match)
             return E_OUTOFMEMORY;
-        jsstr_release(ctx->last_match);
+
+        if(ctx->last_match)
+            jsstr_release(ctx->last_match);
         ctx->last_match = last_match;
     }
 
-- 
1.7.4.1


-- 

Best Regards, André Hentschel


More information about the wine-patches mailing list