From: Simon McVittie Date: Fri, 15 Jul 2022 12:48:03 +0000 (+0100) Subject: test-privserver: Exit if DBusLoop cannot be allocated X-Git-Tag: dbus-1.15.0~27^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9490157ef960e2d58839afbe7fe0cb8e14b010eb;p=thirdparty%2Fdbus.git test-privserver: Exit if DBusLoop cannot be allocated Otherwise, we'd just crash when we dereference the null pointer. Signed-off-by: Simon McVittie --- diff --git a/test/test-privserver.c b/test/test-privserver.c index ee8c5925e..2bcbf8407 100644 --- a/test/test-privserver.c +++ b/test/test-privserver.c @@ -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");