mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-02 09:01:39 -05:00
Use zalloc for structs
When allocating memory for structs, use zalloc instead of malloc. This ensures the memory is zero-initialized, and reduces the risk of forgetting to initialize all struct fields. Signed-off-by: Simon Ser <contact@emersion.fr>
This commit is contained in:
parent
4b05ecb8f7
commit
5eb5620cbd
5 changed files with 14 additions and 14 deletions
|
|
@ -343,7 +343,7 @@ wl_display_create_queue(struct wl_display *display)
|
|||
{
|
||||
struct wl_event_queue *queue;
|
||||
|
||||
queue = malloc(sizeof *queue);
|
||||
queue = zalloc(sizeof *queue);
|
||||
if (queue == NULL)
|
||||
return NULL;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue