tests: fix ptimer leaks

Spotted by ASAN.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Marc-André Lureau 2017-01-27 12:55:51 +04:00
parent 461a862022
commit 072bdb07c5
4 changed files with 79 additions and 37 deletions

View file

@ -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);
}