test: Add some OOM paths to the test-privserver test

This is mostly pointless, but should shut Coverity up.

Coverity ID: 54693
Signed-off-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99722
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
This commit is contained in:
Philip Withnall 2017-02-09 09:35:49 +00:00 committed by Simon McVittie
parent 33098394ba
commit 84cd6243b3

View file

@ -45,11 +45,20 @@ filter_session_message (DBusConnection *connection,
"GetPrivateAddress"))
{
DBusMessage *reply;
reply = dbus_message_new_method_return (message);
dbus_message_append_args (reply, DBUS_TYPE_STRING,
&(testdata->private_addr), DBUS_TYPE_INVALID);
dbus_connection_send (connection, reply, NULL);
if (reply == NULL)
die ("OOM");
if (!dbus_message_append_args (reply, DBUS_TYPE_STRING,
&(testdata->private_addr),
DBUS_TYPE_INVALID))
die ("OOM");
if (!dbus_connection_send (connection, reply, NULL))
die ("Error sending message");
dbus_message_unref (reply);
return DBUS_HANDLER_RESULT_HANDLED;
}
else if (dbus_message_is_method_call (message,