diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2018-05-31 14:50:52 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2018-05-31 14:50:52 +0100 |
commit | 7e3ef27c7c1ccbac589ad0a67c40b5df57e2af71 (patch) | |
tree | 819449d0915fdb71cafda5e2ec4b7fa05cec3569 | |
parent | 60b8fe49cca0cca360adcf9e58fbe5d1612df36d (diff) | |
download | qemu-7e3ef27c7c1ccbac589ad0a67c40b5df57e2af71.zip qemu-7e3ef27c7c1ccbac589ad0a67c40b5df57e2af71.tar.gz qemu-7e3ef27c7c1ccbac589ad0a67c40b5df57e2af71.tar.bz2 |
arm: fix malloc type mismatch
cpregs_keys is an uint32_t* so the allocation should use uint32_t.
g_new is even better because it is type-safe.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r-- | target/arm/gdbstub.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/target/arm/gdbstub.c b/target/arm/gdbstub.c index e80cfb4..0c64c02 100644 --- a/target/arm/gdbstub.c +++ b/target/arm/gdbstub.c @@ -157,8 +157,7 @@ int arm_gen_dynamic_xml(CPUState *cs) RegisterSysregXmlParam param = {cs, s}; cpu->dyn_xml.num_cpregs = 0; - cpu->dyn_xml.cpregs_keys = g_malloc(sizeof(uint32_t *) * - g_hash_table_size(cpu->cp_regs)); + cpu->dyn_xml.cpregs_keys = g_new(uint32_t, g_hash_table_size(cpu->cp_regs)); g_string_printf(s, "<?xml version=\"1.0\"?>"); g_string_append_printf(s, "<!DOCTYPE target SYSTEM \"gdb-target.dtd\">"); g_string_append_printf(s, "<feature name=\"org.qemu.gdb.arm.sys.regs\">"); |