From 3ba235a02284c39b34a68a2a588508ffb52a7b55 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Thu, 4 Dec 2014 13:55:09 +0100 Subject: block: Use g_new0() for a bit of extra type checking g_new(T, 1) is safer than g_malloc(sizeof(T)), because it returns T * rather than void *, which lets the compiler catch more type errors. Missed in commit 02c4f26. Signed-off-by: Markus Armbruster Message-id: 1417697709-13087-1-git-send-email-armbru@redhat.com Signed-off-by: Max Reitz Signed-off-by: Kevin Wolf --- async.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'async.c') diff --git a/async.c b/async.c index 6e1b282..3939b79 100644 --- a/async.c +++ b/async.c @@ -44,7 +44,7 @@ struct QEMUBH { QEMUBH *aio_bh_new(AioContext *ctx, QEMUBHFunc *cb, void *opaque) { QEMUBH *bh; - bh = g_malloc0(sizeof(QEMUBH)); + bh = g_new0(QEMUBH, 1); bh->ctx = ctx; bh->cb = cb; bh->opaque = opaque; -- cgit v1.1