mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2025-12-30 08:20:11 +01:00
dbus_pending_call_set_notify: don't leave the connection locked on OOM
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=51032 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Lennart Poettering <lennart@poettering.net>
This commit is contained in:
parent
a12e6f3ccf
commit
e29efffd88
1 changed files with 6 additions and 2 deletions
|
|
@ -631,6 +631,8 @@ dbus_pending_call_set_notify (DBusPendingCall *pending,
|
|||
void *user_data,
|
||||
DBusFreeFunction free_user_data)
|
||||
{
|
||||
dbus_bool_t ret = FALSE;
|
||||
|
||||
_dbus_return_val_if_fail (pending != NULL, FALSE);
|
||||
|
||||
CONNECTION_LOCK (pending->connection);
|
||||
|
|
@ -638,13 +640,15 @@ dbus_pending_call_set_notify (DBusPendingCall *pending,
|
|||
/* could invoke application code! */
|
||||
if (!_dbus_pending_call_set_data_unlocked (pending, notify_user_data_slot,
|
||||
user_data, free_user_data))
|
||||
return FALSE;
|
||||
goto out;
|
||||
|
||||
pending->function = function;
|
||||
ret = TRUE;
|
||||
|
||||
out:
|
||||
CONNECTION_UNLOCK (pending->connection);
|
||||
|
||||
return TRUE;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue