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 ...@@ -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)); TRACE("%s = %s\n", debugstr_w(prop->name), debugstr_jsval(val));
hres = jsval_copy(val, &prop->u.val); hres = jsval_copy(val, &prop->u.val);
if(FAILED(hres)) { if(FAILED(hres))
prop->u.val = jsval_undefined();
return hres; return hres;
}
if(This->builtin_info->on_put) if(This->builtin_info->on_put)
This->builtin_info->on_put(This, prop->name); This->builtin_info->on_put(This, prop->name);
......
...@@ -212,13 +212,17 @@ static HRESULT jsval_variant(jsval_t *val, VARIANT *var) ...@@ -212,13 +212,17 @@ static HRESULT jsval_variant(jsval_t *val, VARIANT *var)
__JSVAL_TYPE(*val) = JSV_VARIANT; __JSVAL_TYPE(*val) = JSV_VARIANT;
__JSVAL_VAR(*val) = v = heap_alloc(sizeof(VARIANT)); __JSVAL_VAR(*val) = v = heap_alloc(sizeof(VARIANT));
if(!v) if(!v) {
*val = jsval_undefined();
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
}
V_VT(v) = VT_EMPTY; V_VT(v) = VT_EMPTY;
hres = VariantCopy(v, var); hres = VariantCopy(v, var);
if(FAILED(hres)) if(FAILED(hres)) {
*val = jsval_undefined();
heap_free(v); heap_free(v);
}
return hres; 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