fix dbus message leaks

I reviewed all places that call
dbus_connection_send_with_reply_and_block(), and found several places
where dbus messages aren't properly unreffed.
This commit is contained in:
Tanu Kaskinen 2017-07-03 17:35:08 +03:00
parent e538e19664
commit abdd14d5e0
4 changed files with 32 additions and 4 deletions

View file

@ -168,9 +168,15 @@ static int hf_audio_agent_transport_acquire(pa_bluetooth_transport *t, bool opti
dbus_error_init(&derr);
pa_assert_se(m = dbus_message_new_method_call(t->owner, t->path, "org.ofono.HandsfreeAudioCard", "Connect"));
r = dbus_connection_send_with_reply_and_block(pa_dbus_connection_get(card->backend->connection), m, -1, &derr);
dbus_message_unref(m);
m = NULL;
if (!r)
return -1;
dbus_message_unref(r);
r = NULL;
if (card->connecting)
return -EAGAIN;
}