Commit e641469f authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Set output to undefined in jsval_copy on failure.

parent 9fc2863e
......@@ -491,10 +491,8 @@ static HRESULT prop_put(jsdisp_t *This, dispex_prop_t *prop, jsval_t val, IServi
TRACE("%s = %s\n", debugstr_w(prop->name), debugstr_jsval(val));
hres = jsval_copy(val, &prop->u.val);
if(FAILED(hres)) {
prop->u.val = jsval_undefined();
if(FAILED(hres))
return hres;
}
if(This->builtin_info->on_put)
This->builtin_info->on_put(This, prop->name);
......
......@@ -212,13 +212,17 @@ static HRESULT jsval_variant(jsval_t *val, VARIANT *var)
__JSVAL_TYPE(*val) = JSV_VARIANT;
__JSVAL_VAR(*val) = v = heap_alloc(sizeof(VARIANT));
if(!v)
if(!v) {
*val = jsval_undefined();
return E_OUTOFMEMORY;
}
V_VT(v) = VT_EMPTY;
hres = VariantCopy(v, var);
if(FAILED(hres))
if(FAILED(hres)) {
*val = jsval_undefined();
heap_free(v);
}
return hres;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment