diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2017-01-27 12:55:51 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2017-03-01 00:09:28 +0400 |
commit | 072bdb07c5ef8b0351f9973ab5bba9e76be978a9 (patch) | |
tree | 8906bc08d789c2860c340c753dff5e506628fee2 /hw/core/ptimer.c | |
parent | 461a86202214c9c3daf3222a9a655206874bd970 (diff) |
tests: fix ptimer leaks
Spotted by ASAN.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/core/ptimer.c')
-rw-r--r-- | hw/core/ptimer.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/core/ptimer.c b/hw/core/ptimer.c index 3af82afe78..59ccb00550 100644 --- a/hw/core/ptimer.c +++ b/hw/core/ptimer.c @@ -12,6 +12,7 @@ #include "qemu/host-utils.h" #include "sysemu/replay.h" #include "sysemu/qtest.h" +#include "block/aio.h" #define DELTA_ADJUST 1 #define DELTA_NO_ADJUST -1 @@ -353,3 +354,10 @@ ptimer_state *ptimer_init(QEMUBH *bh, uint8_t policy_mask) s->policy_mask = policy_mask; return s; } + +void ptimer_free(ptimer_state *s) +{ + qemu_bh_delete(s->bh); + timer_free(s->timer); + g_free(s); +} |