diff options
author | Simon Kelley <simon@thekelleys.org.uk> | 2022-02-24 23:18:54 +0000 |
---|---|---|
committer | Simon Kelley <simon@thekelleys.org.uk> | 2022-02-24 23:18:54 +0000 |
commit | c27cfeaa7b9bfa09b347f3f26390af39177190db (patch) | |
tree | ffd10bf8660be3fbc79e7b6ef4519ff69ab618e7 | |
parent | bb6f6bae0ba6a95f481485f9d74a89072f2c800c (diff) | |
download | dnsmasq-c27cfeaa7b9bfa09b347f3f26390af39177190db.tar.gz |
Fix memory leak when DBUS connection fails.
-rw-r--r-- | src/dbus.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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); |