From 9c072832f08cd4cb4f9e1bf4fef91c3092434dde Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 15 Mar 2024 13:08:58 +0100 Subject: [PATCH] tests: cleanup correctly to avoid leaks --- src/tests/test-security-context.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tests/test-security-context.c b/src/tests/test-security-context.c index 97e45a913..64754d41a 100644 --- a/src/tests/test-security-context.c +++ b/src/tests/test-security-context.c @@ -105,7 +105,7 @@ static void test_create(void) spa_assert_se(context != NULL); core = pw_context_connect(context, NULL, 0); if (core == NULL && errno == EHOSTDOWN) - return; + goto cleanup; spa_assert_se(core != NULL); spa_zero(info); @@ -155,6 +155,7 @@ static void test_create(void) pw_proxy_destroy((struct pw_proxy*)info.sec); pw_proxy_destroy((struct pw_proxy*)info.registry); +cleanup: pw_context_destroy(context); pw_main_loop_destroy(loop); }