jscript: Added a few missing allocation checks (Coverity).
This commit is contained in:
parent
43c7907f31
commit
ec35d3ab38
|
@ -744,9 +744,13 @@ static HRESULT ArrayConstr_value(DispatchEx *dispex, LCID lcid, WORD flags, DISP
|
||||||
|
|
||||||
static HRESULT alloc_array(script_ctx_t *ctx, BOOL use_constr, ArrayInstance **ret)
|
static HRESULT alloc_array(script_ctx_t *ctx, BOOL use_constr, ArrayInstance **ret)
|
||||||
{
|
{
|
||||||
ArrayInstance *array = heap_alloc_zero(sizeof(ArrayInstance));
|
ArrayInstance *array;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
|
array = heap_alloc_zero(sizeof(ArrayInstance));
|
||||||
|
if(!array)
|
||||||
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
if(use_constr)
|
if(use_constr)
|
||||||
hres = init_dispex_from_constr(&array->dispex, ctx, &Array_info, ctx->array_constr);
|
hres = init_dispex_from_constr(&array->dispex, ctx, &Array_info, ctx->array_constr);
|
||||||
else
|
else
|
||||||
|
|
|
@ -758,6 +758,8 @@ HRESULT WINAPI JScriptFactory_CreateInstance(IClassFactory *iface, IUnknown *pUn
|
||||||
lock_module();
|
lock_module();
|
||||||
|
|
||||||
ret = heap_alloc_zero(sizeof(*ret));
|
ret = heap_alloc_zero(sizeof(*ret));
|
||||||
|
if(!ret)
|
||||||
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
ret->lpIActiveScriptVtbl = &JScriptVtbl;
|
ret->lpIActiveScriptVtbl = &JScriptVtbl;
|
||||||
ret->lpIActiveScriptParseVtbl = &JScriptParseVtbl;
|
ret->lpIActiveScriptParseVtbl = &JScriptParseVtbl;
|
||||||
|
|
|
@ -231,9 +231,13 @@ static HRESULT NumberConstr_value(DispatchEx *dispex, LCID lcid, WORD flags, DIS
|
||||||
|
|
||||||
static HRESULT alloc_number(script_ctx_t *ctx, BOOL use_constr, NumberInstance **ret)
|
static HRESULT alloc_number(script_ctx_t *ctx, BOOL use_constr, NumberInstance **ret)
|
||||||
{
|
{
|
||||||
NumberInstance *number = heap_alloc_zero(sizeof(NumberInstance));
|
NumberInstance *number;
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
|
number = heap_alloc_zero(sizeof(NumberInstance));
|
||||||
|
if(!number)
|
||||||
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
if(use_constr)
|
if(use_constr)
|
||||||
hres = init_dispex_from_constr(&number->dispex, ctx, &Number_info, ctx->number_constr);
|
hres = init_dispex_from_constr(&number->dispex, ctx, &Number_info, ctx->number_constr);
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue