diff options
author | Markus Armbruster <armbru@redhat.com> | 2014-12-04 13:55:09 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2014-12-10 10:31:21 +0100 |
commit | 3ba235a02284c39b34a68a2a588508ffb52a7b55 (patch) | |
tree | 8d1ba626ba4866334e81b4821ce9fbd137cc8d95 /aio-posix.c | |
parent | 625fa9fe6fbf9d45607d2c0144e1a44712d0cefc (diff) | |
download | qemu-3ba235a02284c39b34a68a2a588508ffb52a7b55.zip qemu-3ba235a02284c39b34a68a2a588508ffb52a7b55.tar.gz qemu-3ba235a02284c39b34a68a2a588508ffb52a7b55.tar.bz2 |
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 <armbru@redhat.com>
Message-id: 1417697709-13087-1-git-send-email-armbru@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'aio-posix.c')
-rw-r--r-- | aio-posix.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/aio-posix.c b/aio-posix.c index d3ac06e..cbd4c34 100644 --- a/aio-posix.c +++ b/aio-posix.c @@ -73,7 +73,7 @@ void aio_set_fd_handler(AioContext *ctx, } else { if (node == NULL) { /* Alloc and insert if it's not already there */ - node = g_malloc0(sizeof(AioHandler)); + node = g_new0(AioHandler, 1); node->pfd.fd = fd; QLIST_INSERT_HEAD(&ctx->aio_handlers, node, node); |