In general, dbus_message_unref should be avoided while holding locks,
because it can invoke arbitrary user callbacks (via attached data, or
via DBusCounter).
Reviewed-by: Colin Walters <walters@verbum.org>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34393
if (preallocated == NULL)
{
if (preallocated == NULL)
{
+ /* It's OK that this is finalized, because it hasn't been seen by
+ * anything that could attach user callbacks */
dbus_message_unref (reply);
result = DBUS_HANDLER_RESULT_NEED_MEMORY;
_dbus_verbose ("no memory for error send in dispatch\n");
dbus_message_unref (reply);
result = DBUS_HANDLER_RESULT_NEED_MEMORY;
_dbus_verbose ("no memory for error send in dispatch\n");
reply_link = _dbus_list_alloc_link (reply);
if (reply_link == NULL)
{
reply_link = _dbus_list_alloc_link (reply);
if (reply_link == NULL)
{
+ /* it's OK to unref this, nothing that could have attached a callback
+ * has ever seen it */
dbus_message_unref (reply);
return FALSE;
}
dbus_message_unref (reply);
return FALSE;
}