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>
dev
Pekka Paalanen 5 years ago committed by Pekka Paalanen
parent ecdf50d38e
commit 209187491b
  1. 2
      libweston/noop-renderer.c

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

Loading…
Cancel
Save