aboutsummaryrefslogtreecommitdiff
path: root/render/allocator/allocator.c
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2022-04-26 09:43:54 +0200
committerSimon Ser <contact@emersion.fr>2022-04-28 10:09:50 +0200
commit6c350799b22ddc5cb89467c95692437bbf0116b9 (patch)
tree4559c68cb117d9c044e79fb0fbb7453042538375 /render/allocator/allocator.c
parent54653b5d95935e379e26db5518456a66384b5405 (diff)
Zero-initialize structs in init functions
Ensures there is no field left to its previous undefined value after calling an init function.
Diffstat (limited to 'render/allocator/allocator.c')
-rw-r--r--render/allocator/allocator.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/render/allocator/allocator.c b/render/allocator/allocator.c
index 2c75421f..83e836ae 100644
--- a/render/allocator/allocator.c
+++ b/render/allocator/allocator.c
@@ -18,6 +18,7 @@
void wlr_allocator_init(struct wlr_allocator *alloc,
const struct wlr_allocator_interface *impl, uint32_t buffer_caps) {
assert(impl && impl->destroy && impl->create_buffer);
+ memset(alloc, 0, sizeof(*alloc));
alloc->impl = impl;
alloc->buffer_caps = buffer_caps;
wl_signal_init(&alloc->events.destroy);