From 5c5c9a64bc6c2d995a827aa97eb37f45455eeccd Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 27 Nov 2017 19:14:57 +0000 Subject: [PATCH 3/9] test_try_connect_to_bus: Don't leak the connection on OOM Signed-off-by: Simon McVittie --- test/test-utils-glib.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/test-utils-glib.c b/test/test-utils-glib.c index a539c5c8..fd804c96 100644 --- a/test/test-utils-glib.c +++ b/test/test-utils-glib.c @@ -353,6 +353,12 @@ fail: if (gerror != NULL) *gerror = g_dbus_error_new_for_dbus_error (error.name, error.message); + if (conn != NULL) + { + dbus_connection_close (conn); + dbus_connection_unref (conn); + } + dbus_error_free (&error); return FALSE; } -- 2.15.0