libcacard uses a global context, but we can call finalize since
vcard_emul_init() would have failed earlier if a second card context was
used.
This fixes libtss2-fapi leaks spotted by ASAN.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
hw/usb/ccid-card-emulated.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c
index 985f21997aa8..6c8eec39faa9 100644
--- a/hw/usb/ccid-card-emulated.c
+++ b/hw/usb/ccid-card-emulated.c
@@ -580,6 +580,8 @@ static void emulated_unrealize(CCIDCardState *base)
qemu_mutex_destroy(&card->handle_apdu_mutex);
qemu_mutex_destroy(&card->vreader_mutex);
qemu_mutex_destroy(&card->event_list_mutex);
+
+ vcard_emul_finalize();
}
static const Property emulated_card_properties[] = {
--
2.55.0