From: Simon McVittie Date: Mon, 27 Nov 2017 19:14:57 +0000 (+0000) Subject: test_try_connect_to_bus: Don't leak the connection on OOM X-Git-Tag: dbus-1.13.0~63 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d5d7d099798ff780dce73236bd4b33fe3c0dd9b5;p=thirdparty%2Fdbus.git test_try_connect_to_bus: Don't leak the connection on OOM Bug: https://bugs.freedesktop.org/show_bug.cgi?id=100317 Reviewed-by: Philip Withnall Signed-off-by: Simon McVittie --- diff --git a/test/test-utils-glib.c b/test/test-utils-glib.c index a539c5c84..fd804c967 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; }