From 7eb304c54ee8ea6dfa3775cf89d63c39295747a8 Mon Sep 17 00:00:00 2001 From: Olivier Andrieu Date: Thu, 22 Jul 2004 07:07:01 +0000 Subject: 2004-07-22 Olivier Andrieu * dbus/dbus-sysdeps.c (fill_user_info): fix inexistent label name, breaking build on Solaris, reported by Farhad Saberi on the ML. * dbus/dbus-message.c (dbus_message_append_args_valist): fix the va_arg invocation to account for integer promotion in the case of DBUS_TYPE_BYTE (unsigned char is promoted to int). (bug #901) * bus/services.c (bus_service_remove_owner): fix bug #902, use _dbus_list_get_first_link, not _dbus_list_get_first. * dbus/dbus-bus.c (dbus_bus_service_exists): plug a memory leak. * dbus/dbus-object-tree.c (free_subtree_recurse): always null handler functions so that the asserts in _dbus_object_subtree_unref do not fail. * dbus/dbus-transport-unix.c (do_reading): _dbus_transport_queue_messages return value is of type dbus_bool_t, not DBusDispatchStatus. --- dbus/dbus-bus.c | 6 ++++-- dbus/dbus-message.c | 7 +++---- dbus/dbus-object-tree.c | 13 ++++++------- dbus/dbus-sysdeps.c | 2 +- dbus/dbus-transport-unix.c | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) (limited to 'dbus') diff --git a/dbus/dbus-bus.c b/dbus/dbus-bus.c index 7b609d67..4dd2eaf9 100644 --- a/dbus/dbus-bus.c +++ b/dbus/dbus-bus.c @@ -713,7 +713,7 @@ dbus_bus_service_exists (DBusConnection *connection, DBusError *error) { DBusMessage *message, *reply; - unsigned int exists; + dbus_bool_t exists; _dbus_return_val_if_fail (connection != NULL, FALSE); _dbus_return_val_if_fail (service_name != NULL, FALSE); @@ -752,10 +752,12 @@ dbus_bus_service_exists (DBusConnection *connection, DBUS_TYPE_INVALID)) { _DBUS_ASSERT_ERROR_IS_SET (error); + dbus_message_unref (reply); return FALSE; } - return (exists != FALSE); + dbus_message_unref (reply); + return exists; } /** diff --git a/dbus/dbus-message.c b/dbus/dbus-message.c index 2e4c9b35..8887720a 100644 --- a/dbus/dbus-message.c +++ b/dbus/dbus-message.c @@ -3984,10 +3984,9 @@ dbus_message_append_args_valist (DBusMessage *message, goto errorout; break; case DBUS_TYPE_BYTE: - /* FIXME if you pass an unsigned char to varargs it gets promoted to int, - * so probably we should read an int here. - */ - if (!dbus_message_iter_append_byte (&iter, va_arg (var_args, unsigned char))) + /* Read an int from varargs, because the original unsigned + * char has been promoted to int. */ + if (!dbus_message_iter_append_byte (&iter, va_arg (var_args, int))) goto errorout; break; case DBUS_TYPE_BOOLEAN: diff --git a/dbus/dbus-object-tree.c b/dbus/dbus-object-tree.c index 3ec97320..4f82d6f5 100644 --- a/dbus/dbus-object-tree.c +++ b/dbus/dbus-object-tree.c @@ -536,13 +536,12 @@ free_subtree_recurse (DBusConnection *connection, /* Call application code */ if (subtree->unregister_function) - { - (* subtree->unregister_function) (connection, - subtree->user_data); - subtree->message_function = NULL; - subtree->unregister_function = NULL; - subtree->user_data = NULL; - } + (* subtree->unregister_function) (connection, + subtree->user_data); + + subtree->message_function = NULL; + subtree->unregister_function = NULL; + subtree->user_data = NULL; /* Now free ourselves */ _dbus_object_subtree_unref (subtree); diff --git a/dbus/dbus-sysdeps.c b/dbus/dbus-sysdeps.c index ed1e61a2..3a0947e1 100644 --- a/dbus/dbus-sysdeps.c +++ b/dbus/dbus-sysdeps.c @@ -1549,7 +1549,7 @@ fill_user_info (DBusUserInfo *info, if (info->group_ids == NULL) { dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL); - goto out; + goto failed; } info->n_group_ids = 1; diff --git a/dbus/dbus-transport-unix.c b/dbus/dbus-transport-unix.c index 0c6e9cd4..2e942abc 100644 --- a/dbus/dbus-transport-unix.c +++ b/dbus/dbus-transport-unix.c @@ -686,7 +686,7 @@ do_reading (DBusTransport *transport) total += bytes_read; - if (_dbus_transport_queue_messages (transport) == DBUS_DISPATCH_NEED_MEMORY) + if (!_dbus_transport_queue_messages (transport)) { oom = TRUE; _dbus_verbose (" out of memory when queueing messages we just read in the transport\n"); -- cgit