mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-02-28 01:41:19 -05:00
Use zalloc instead of malloc + memset
Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
This commit is contained in:
parent
3de1783e50
commit
2e7fb78682
5 changed files with 15 additions and 18 deletions
|
|
@ -163,10 +163,10 @@ wl_connection_create(int fd)
|
|||
{
|
||||
struct wl_connection *connection;
|
||||
|
||||
connection = malloc(sizeof *connection);
|
||||
connection = zalloc(sizeof *connection);
|
||||
if (connection == NULL)
|
||||
return NULL;
|
||||
memset(connection, 0, sizeof *connection);
|
||||
|
||||
connection->fd = fd;
|
||||
|
||||
return connection;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue