jscript: Use jsstr_flush in variant_change_type.

This commit is contained in:
Jacek Caban 2013-03-05 11:50:03 +01:00 committed by Alexandre Julliard
parent 0eeb5c17b4
commit 88e78eb16e
1 changed files with 4 additions and 2 deletions

View File

@ -903,8 +903,10 @@ HRESULT variant_change_type(script_ctx_t *ctx, VARIANT *dst, VARIANT *src, VARTY
break;
}
V_BSTR(dst) = SysAllocStringLen(str->str, jsstr_length(str));
if(!V_BSTR(dst))
V_BSTR(dst) = SysAllocStringLen(NULL, jsstr_length(str));
if(V_BSTR(dst))
jsstr_flush(str, V_BSTR(dst));
else
hres = E_OUTOFMEMORY;
break;
}