Nikolay Sivov : jscript/tests: Test for script object creation failure ( Coverity).

Alexandre Julliard julliard at winehq.org
Mon Jan 8 16:08:07 CST 2018


Module: wine
Branch: master
Commit: 8643a17ff3a9cb6209a76c4170c9b7deede5d020
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=8643a17ff3a9cb6209a76c4170c9b7deede5d020

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Mon Jan  8 17:57:22 2018 +0300

jscript/tests: Test for script object creation failure (Coverity).

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/jscript/tests/run.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/dlls/jscript/tests/run.c b/dlls/jscript/tests/run.c
index bd5e341..887b264 100644
--- a/dlls/jscript/tests/run.c
+++ b/dlls/jscript/tests/run.c
@@ -2147,6 +2147,8 @@ static HRESULT parse_script_expr(const char *expr, VARIANT *res, IActiveScript *
     HRESULT hres;
 
     engine = create_script();
+    if(!engine)
+        return E_FAIL;
 
     hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
     ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
@@ -2191,6 +2193,8 @@ static void test_retval(void)
     HRESULT hres;
 
     engine = create_script();
+    if(!engine)
+        return;
 
     hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
     ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);




More information about the wine-cvs mailing list