From cee80c92b624efa73ac4a41ce9f46643f1934ab2 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 9 Feb 2017 09:45:59 +0000 Subject: [PATCH] test: Add some OOM paths to the test-pending-call-timeout test This is mostly pointless, but will shut Coverity up. Coverity ID: 54718 Signed-off-by: Philip Withnall Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99724 Reviewed-by: Simon McVittie --- test/name-test/test-pending-call-timeout.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/name-test/test-pending-call-timeout.c b/test/name-test/test-pending-call-timeout.c index 6035df8..a204db0 100644 --- a/test/name-test/test-pending-call-timeout.c +++ b/test/name-test/test-pending-call-timeout.c @@ -25,8 +25,13 @@ _method_call (DBusConnection *conn, "org.freedesktop.TestSuite", "DelayEcho"); - dbus_message_append_args (method, DBUS_TYPE_STRING, &echo, NULL); - dbus_connection_send_with_reply (conn, method, &pending, timeout_milliseconds); + if (method == NULL || + !dbus_message_append_args (method, DBUS_TYPE_STRING, &echo, NULL) || + !dbus_connection_send_with_reply (conn, method, &pending, timeout_milliseconds)) + { + printf ("Bail out! OOM when building and sending message ***\n"); + exit (1); + } dbus_message_unref (method); /* block on the message */ -- 2.7.4