diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2017-10-06 20:49:56 -0300 |
---|---|---|
committer | Thomas Huth <thuth@redhat.com> | 2017-10-16 13:29:49 +0200 |
commit | 790bbb9768e6a21920e76989f931db80ca67dc10 (patch) | |
tree | 0fc32564560acb9210742fb2a5fa947b8f7d5fb7 /tests/ahci-test.c | |
parent | d3c9218840c070f1c81ac20bc02fb6aafc6e3803 (diff) |
tests: use g_new() family of functions
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
[PMD: split of some files in other commits of the same series, add libqtest.c]
Acked-by: John Snow <jsnow@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/ahci-test.c')
-rw-r--r-- | tests/ahci-test.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/ahci-test.c b/tests/ahci-test.c index 999121bb7c..cb84edc8fb 100644 --- a/tests/ahci-test.c +++ b/tests/ahci-test.c @@ -155,7 +155,7 @@ static AHCIQState *ahci_vboot(const char *cli, va_list ap) { AHCIQState *s; - s = g_malloc0(sizeof(AHCIQState)); + s = g_new0(AHCIQState, 1); s->parent = qtest_pc_vboot(cli, ap); alloc_set_flags(s->parent->alloc, ALLOC_LEAK_ASSERT); @@ -1806,7 +1806,7 @@ static void create_ahci_io_test(enum IOMode type, enum AddrMode addr, char *name; AHCIIOTestOptions *opts; - opts = g_malloc(sizeof(AHCIIOTestOptions)); + opts = g_new(AHCIIOTestOptions, 1); opts->length = len; opts->address_type = addr; opts->io_type = type; |