qedit/nullrenderer: Use calloc() in null_renderer_create().

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-03-30 17:55:13 -05:00 committed by Alexandre Julliard
parent 933195d0b6
commit e838381a64
1 changed files with 7 additions and 8 deletions

View File

@ -52,7 +52,7 @@ static void null_renderer_destroy(struct strmbase_renderer *iface)
NullRendererImpl *filter = impl_from_strmbase_renderer(iface);
strmbase_renderer_cleanup(&filter->renderer);
CoTaskMemFree(filter);
free(filter);
}
static const struct strmbase_renderer_ops renderer_ops =
@ -64,15 +64,14 @@ static const struct strmbase_renderer_ops renderer_ops =
HRESULT null_renderer_create(IUnknown *outer, IUnknown **out)
{
NullRendererImpl *pNullRenderer;
NullRendererImpl *object;
*out = NULL;
if (!(object = calloc(1, sizeof(*object))))
return E_OUTOFMEMORY;
pNullRenderer = CoTaskMemAlloc(sizeof(NullRendererImpl));
strmbase_renderer_init(&object->renderer, outer, &CLSID_NullRenderer, L"In", &renderer_ops);
strmbase_renderer_init(&pNullRenderer->renderer, outer,
&CLSID_NullRenderer, L"In", &renderer_ops);
*out = &pNullRenderer->renderer.filter.IUnknown_inner;
TRACE("Created null renderer %p.\n", object);
*out = &object->renderer.filter.IUnknown_inner;
return S_OK;
}