From 5f63c56d48a1922a138d25f1fdb3cb18fcacb6a6 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Mon, 3 Nov 2014 17:20:54 +0100 Subject: [PATCH] emulator/bthost: Simplify bthost_create Use new0 instead of malloc+memset for allocating bthost. --- emulator/bthost.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/emulator/bthost.c b/emulator/bthost.c index a2c72a941..a1232286e 100644 --- a/emulator/bthost.c +++ b/emulator/bthost.c @@ -219,12 +219,10 @@ struct bthost *bthost_create(void) { struct bthost *bthost; - bthost = malloc(sizeof(*bthost)); + bthost = new0(struct bthost, 1); if (!bthost) return NULL; - memset(bthost, 0, sizeof(*bthost)); - /* Set defaults */ bthost->io_capability = 0x03; -- 2.47.3