noop-renderer: zero-initialize struct

This ensures that all function pointers we do not fill in will be NULL.

I had a crash in the Xwayland test with
https://gitlab.freedesktop.org/wayland/weston/merge_requests/274 without this,
because import_dmabuf was garbage.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This commit is contained in:
Pekka Paalanen 2019-10-02 13:39:41 +03:00 committed by Pekka Paalanen
parent ecdf50d38e
commit 209187491b
1 changed files with 1 additions and 1 deletions

View File

@ -106,7 +106,7 @@ noop_renderer_init(struct weston_compositor *ec)
{
struct weston_renderer *renderer;
renderer = malloc(sizeof *renderer);
renderer = zalloc(sizeof *renderer);
if (renderer == NULL)
return -1;