From e748ead5cf41a72a92cab16a9b1deee2ca2e74c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Thu, 22 Jun 2023 16:19:01 +0300 Subject: [PATCH] jscript: Use jsstr_empty instead of allocating empty string. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu --- dlls/jscript/json.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/dlls/jscript/json.c b/dlls/jscript/json.c index 7826000f87d..e07ad863348 100644 --- a/dlls/jscript/json.c +++ b/dlls/jscript/json.c @@ -396,13 +396,11 @@ static HRESULT JSON_parse(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned if(SUCCEEDED(hres)) { struct transform_json_object_ctx proc_ctx = { ctx, get_object(argv[1]), S_OK }; - if(!(str = jsstr_alloc(L""))) - hres = E_OUTOFMEMORY; - else { - ret = transform_json_object(&proc_ctx, root, str); - jsstr_release(str); - hres = proc_ctx.hres; - } + + str = jsstr_empty(); + ret = transform_json_object(&proc_ctx, root, str); + jsstr_release(str); + hres = proc_ctx.hres; } jsdisp_release(root); if(FAILED(hres))