]> Git Repo - qemu.git/commit - migration/qemu-file-stdio.c
migration: Use g_new() & friends where that makes obvious sense
authorMarkus Armbruster <[email protected]>
Mon, 14 Sep 2015 11:51:31 +0000 (13:51 +0200)
committerAmit Shah <[email protected]>
Tue, 29 Sep 2015 06:06:35 +0000 (11:36 +0530)
commit97f3ad35517e0d02c0149637d1bb10713c52b057
tree73f29aa9a4099bf48ceb0708bd1706fe6852b04d
parent56f3835ff1e70df97f843f4a27abdff6b4a2ae77
migration: Use g_new() & friends where that makes obvious sense

g_new(T, n) is neater than g_malloc(sizeof(T) * n).  It's also safer,
for two reasons.  One, it catches multiplication overflowing size_t.
Two, it returns T * rather than void *, which lets the compiler catch
more type errors.

This commit only touches allocations with size arguments of the form
sizeof(T).  Same Coccinelle semantic patch as in commit b45c03f.

Signed-off-by: Markus Armbruster <[email protected]>
Message-Id: <1442231491[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: zhanghailiang <[email protected]>
Reviewed-by: Amit Shah <[email protected]>
Signed-off-by: Amit Shah <[email protected]>
migration/migration.c
migration/qemu-file-buf.c
migration/qemu-file-stdio.c
migration/qemu-file-unix.c
migration/qemu-file.c
migration/rdma.c
migration/savevm.c
This page took 0.027529 seconds and 4 git commands to generate.