diff options
author | Peter Maydell | 2018-12-14 14:30:55 +0100 |
---|---|---|
committer | Peter Maydell | 2018-12-14 14:30:55 +0100 |
commit | 397cd31f01228c42d32261a6db3ead140cac8a7c (patch) | |
tree | 61a065de78882855b498569b0855bdc5536cfbbe /hw/sparc | |
parent | tests/test-arm-mptimer: Don't leak string memory (diff) | |
download | qemu-397cd31f01228c42d32261a6db3ead140cac8a7c.tar.gz qemu-397cd31f01228c42d32261a6db3ead140cac8a7c.tar.xz qemu-397cd31f01228c42d32261a6db3ead140cac8a7c.zip |
target/arm: Create timers in realize, not init
The timer_new() function allocates memory; this means that
if we call it in the CPU's init method we would need
to provide an instance_finalize method to free it. Defer
the timer creation to the realize function instead.
This fixes a memory leak spotted by clang LeakSanitizer
when a CPU object is created for introspection.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20181204132952.2601-6-peter.maydell@linaro.org
Diffstat (limited to 'hw/sparc')
0 files changed, 0 insertions, 0 deletions