diff options
author | Ralf Habacker <ralf.habacker@freenet.de> | 2021-12-09 09:51:09 +0100 |
---|---|---|
committer | Ralf Habacker <ralf.habacker@freenet.de> | 2021-12-09 12:54:22 +0100 |
commit | 3a2e0ba5fec9a162ff5968975ab4b5499ac13bd8 (patch) | |
tree | 4b5a726eeb50558d968b0e2db883fea0645167cd /bus | |
parent | 5b804ed77d336770354939e24b5b09ed95d1b4ba (diff) | |
download | dbus-3a2e0ba5fec9a162ff5968975ab4b5499ac13bd8.tar.gz |
Avoid assertation in bus_activation_reload()
In the mentioned function a local DBusError instance is now used to
fulfill the requirement of dbus_error_has_name() that the parameter
'error' must not be null.
See #360
Diffstat (limited to 'bus')
-rw-r--r-- | bus/activation.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/bus/activation.c b/bus/activation.c index 19ac869a..48a44a30 100644 --- a/bus/activation.c +++ b/bus/activation.c @@ -898,6 +898,7 @@ bus_activation_reload (BusActivation *activation, { DBusList *link; char *dir; + DBusError local_error = DBUS_ERROR_INIT; if (activation->server_address != NULL) dbus_free (activation->server_address); @@ -965,13 +966,18 @@ bus_activation_reload (BusActivation *activation, } /* only fail on OOM, it is ok if we can't read the directory */ - if (!update_directory (activation, s_dir, error)) - { - if (dbus_error_has_name (error, DBUS_ERROR_NO_MEMORY)) - goto failed; - else - dbus_error_free (error); - } + if (!update_directory (activation, s_dir, &local_error)) + { + if (dbus_error_has_name (&local_error, DBUS_ERROR_NO_MEMORY)) + { + dbus_move_error (&local_error, error); + goto failed; + } + else + { + dbus_error_free (&local_error); + } + } link = _dbus_list_get_next_link (directories, link); } |