From e817d2e67835a80761fd33c4a1ed445c3309f3e7 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Wed, 24 May 2023 01:46:52 -0700 Subject: test: don't leave global pointing to stack memory (#735) test_device_is_stopped_and_copying points the global vfu_ctx structure to a local stack-allocated data structure. This is fine while the function is executing, but newer gcc complains that the pointer is left there after it returns. So clear the pointer to NULL before returning. Fixes issue #734. Reported-by: Kamil Godzwon Signed-off-by: Jim Harris --- test/unit-tests.c | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/unit-tests.c b/test/unit-tests.c index 26ad304..0fd4fe7 100644 --- a/test/unit-tests.c +++ b/test/unit-tests.c @@ -601,6 +601,7 @@ test_device_is_stopped_and_copying(UNUSED void **state) assert_false(r); } } + vfu_ctx.migration = NULL; } static void -- cgit v1.1