Zero-initialize structs in init functions

Ensures there is no field left to its previous undefined value after
calling an init function.
This commit is contained in:
Simon Ser 2022-04-26 09:43:54 +02:00
parent 54653b5d95
commit 6c350799b2
20 changed files with 29 additions and 1 deletions

View file

@ -39,6 +39,8 @@ void wlr_renderer_init(struct wlr_renderer *renderer,
assert(impl->render_quad_with_matrix);
assert(impl->get_shm_texture_formats);
assert(impl->get_render_buffer_caps);
memset(renderer, 0, sizeof(*renderer));
renderer->impl = impl;
wl_signal_init(&renderer->events.destroy);