diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2017-06-07 00:45:43 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2017-08-31 12:29:07 +0200 |
commit | ad2c19937e0b80f8037e411f72e6d6078fe673ca (patch) | |
tree | 846045b338cef4bba27c8354f2c6a166c159227a /hw/i386 | |
parent | 18a1f0d767852a7d6a000bffeb65d8825ae83a79 (diff) | |
download | qemu-ad2c19937e0b80f8037e411f72e6d6078fe673ca.zip qemu-ad2c19937e0b80f8037e411f72e6d6078fe673ca.tar.gz qemu-ad2c19937e0b80f8037e411f72e6d6078fe673ca.tar.bz2 |
i386: replace g_malloc()+memcpy() with g_memdup()
I found these pattern via grepping the source tree. I don't have a
coccinelle script for it!
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'hw/i386')
-rw-r--r-- | hw/i386/multiboot.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/hw/i386/multiboot.c b/hw/i386/multiboot.c index f13e231..6001f4c 100644 --- a/hw/i386/multiboot.c +++ b/hw/i386/multiboot.c @@ -352,8 +352,7 @@ int load_multiboot(FWCfgState *fw_cfg, mb_debug(" mb_mods_count = %d\n", mbs.mb_mods_count); /* save bootinfo off the stack */ - mb_bootinfo_data = g_malloc(sizeof(bootinfo)); - memcpy(mb_bootinfo_data, bootinfo, sizeof(bootinfo)); + mb_bootinfo_data = g_memdup(bootinfo, sizeof(bootinfo)); /* Pass variables to option rom */ fw_cfg_add_i32(fw_cfg, FW_CFG_KERNEL_ENTRY, mh_entry_addr); |