summaryrefslogtreecommitdiffstats
path: root/src/connection.c
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2015-08-26 12:00:06 +0800
committerJonas Ådahl <jadahl@gmail.com>2016-01-12 12:13:12 +0800
commit2e7fb786825472d2a4b717e0b82d216aa90fb3e0 (patch)
tree946e0c464eb65330da1b65ba1321788a3597fe8b /src/connection.c
parentscanner: Fail if 'since' is higher than the interface version (diff)
downloadwayland-2e7fb786825472d2a4b717e0b82d216aa90fb3e0.tar
wayland-2e7fb786825472d2a4b717e0b82d216aa90fb3e0.tar.gz
wayland-2e7fb786825472d2a4b717e0b82d216aa90fb3e0.tar.bz2
wayland-2e7fb786825472d2a4b717e0b82d216aa90fb3e0.tar.lz
wayland-2e7fb786825472d2a4b717e0b82d216aa90fb3e0.tar.xz
wayland-2e7fb786825472d2a4b717e0b82d216aa90fb3e0.tar.zst
wayland-2e7fb786825472d2a4b717e0b82d216aa90fb3e0.zip
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>
Diffstat (limited to 'src/connection.c')
-rw-r--r--src/connection.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/connection.c b/src/connection.c
index 6742f19..45a2e78 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -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;