summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorMarc-André Lureau2017-01-27 09:55:51 +0100
committerMarc-André Lureau2017-02-28 21:09:28 +0100
commit072bdb07c5ef8b0351f9973ab5bba9e76be978a9 (patch)
tree8906bc08d789c2860c340c753dff5e506628fee2 /hw
parentglib-compat: add g_test_add_data_func_full fallback (diff)
downloadqemu-072bdb07c5ef8b0351f9973ab5bba9e76be978a9.tar.gz
qemu-072bdb07c5ef8b0351f9973ab5bba9e76be978a9.tar.xz
qemu-072bdb07c5ef8b0351f9973ab5bba9e76be978a9.zip
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')
-rw-r--r--hw/core/ptimer.c8
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);
+}