diff options
| author | Markus Armbruster | 2014-12-04 14:28:17 +0100 |
|---|---|---|
| committer | Stefan Hajnoczi | 2014-12-19 14:17:02 +0100 |
| commit | 58889fe50a7c5b8776cf3096a8fe611fb66c4e5c (patch) | |
| tree | c5cf3f17b67b4cfe5573942b02b78a7435d86dfe /scripts/checkpatch.pl | |
| parent | net: Fuse g_malloc(); memset() into g_new0() (diff) | |
| download | qemu-58889fe50a7c5b8776cf3096a8fe611fb66c4e5c.tar.gz qemu-58889fe50a7c5b8776cf3096a8fe611fb66c4e5c.tar.xz qemu-58889fe50a7c5b8776cf3096a8fe611fb66c4e5c.zip | |
net: 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).
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'scripts/checkpatch.pl')
0 files changed, 0 insertions, 0 deletions
