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 a2c72a9..a123228 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; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html