From 9fe5da83438a3eae74b7d6b3e9930ec5d2e2eb84 Mon Sep 17 00:00:00 2001 From: William Henderson Date: Mon, 31 Jul 2023 15:32:52 +0000 Subject: test: fix memory leak in unit tests Signed-off-by: William Henderson --- test/unit-tests.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/unit-tests.c b/test/unit-tests.c index 7f3e924..a652bc2 100644 --- a/test/unit-tests.c +++ b/test/unit-tests.c @@ -518,6 +518,12 @@ static int teardown_test_setup_migration(void **state) { struct test_setup_migr_reg_dat *p = *state; vfu_destroy_ctx(p->v); + + if (LAST_WRITE != NULL) { + free(LAST_WRITE); + LAST_WRITE = NULL; + } + return 0; } -- cgit v1.1