Fix memory leak when DBUS connection fails.

This commit is contained in:
Simon Kelley committed 2022-02-24 23:18:54 +00:00
1 parent bb6f6bae0b
commit c27cfeaa7b
1 file changed
+5 -2
+5 -2
View File
@@ -761,8 +761,11 @@ char *dbus_init(void)
dbus_error_init (&dbus_error);
if (!(connection = dbus_bus_get (DBUS_BUS_SYSTEM, &dbus_error)))
return NULL;
{
dbus_error_free(&dbus_error);
return NULL;
}
dbus_connection_set_exit_on_disconnect(connection, FALSE);
dbus_connection_set_watch_functions(connection, add_watch, remove_watch,
NULL, NULL, NULL);