mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 10:18:25 +00:00
Fix memory leak when DBUS connection fails.
This commit is contained in:
@@ -761,8 +761,11 @@ char *dbus_init(void)
|
|||||||
|
|
||||||
dbus_error_init (&dbus_error);
|
dbus_error_init (&dbus_error);
|
||||||
if (!(connection = dbus_bus_get (DBUS_BUS_SYSTEM, &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_exit_on_disconnect(connection, FALSE);
|
||||||
dbus_connection_set_watch_functions(connection, add_watch, remove_watch,
|
dbus_connection_set_watch_functions(connection, add_watch, remove_watch,
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user