Signed-off-by: Paul Gofman pgofman@codeweavers.com --- dlls/jscript/json.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/jscript/json.c b/dlls/jscript/json.c index a8014f95b4f..20234807727 100644 --- a/dlls/jscript/json.c +++ b/dlls/jscript/json.c @@ -291,16 +291,21 @@ static HRESULT JSON_parse(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsign parse_ctx.end = buf + jsstr_length(str); parse_ctx.ctx = ctx; hres = parse_json_value(&parse_ctx, &ret); - jsstr_release(str); if(FAILED(hres)) + { + jsstr_release(str); return hres; + }
if(skip_spaces(&parse_ctx)) { FIXME("syntax error\n"); + jsstr_release(str); jsval_release(ret); return E_FAIL; }
+ jsstr_release(str); + if(r) *r = ret; else