mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
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:
parent
461a862022
commit
072bdb07c5
4 changed files with 79 additions and 37 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue