test-privserver: Exit if DBusLoop cannot be allocated

Otherwise, we'd just crash when we dereference the null pointer.

Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
Simon McVittie 2022-07-15 13:48:03 +01:00
parent 76296a5f0b
commit 9490157ef9

View file

@ -127,6 +127,9 @@ main (int argc, char *argv[])
testdata = dbus_new (TestServiceData, 1);
testdata->loop = _dbus_loop_new ();
if (testdata->loop == NULL)
die ("out of memory");
session = dbus_bus_get (DBUS_BUS_SESSION, &error);
if (!session)
die ("couldn't access session bus");