summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2017-05-04 13:11:27 +0200
committerGeorg Chini <georg@chini.tk>2017-05-04 13:12:08 +0200
commit826bb358cc818e5687c266becf68d72fb56d08c9 (patch)
tree8b7cd67046173dc3ba1c9dcb7456e36777a7525a
parent69c212f8c13794f70899d1fe6baec1b6e3c92032 (diff)
downloadpulseaudio-826bb358cc818e5687c266becf68d72fb56d08c9.tar.gz
bluetooth: ofono: Close fd if cannot be accepted
Always close fd that cannot be accepted otherwise it will be left open without being attached to any transport.
-rw-r--r--src/modules/bluetooth/backend-ofono.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/modules/bluetooth/backend-ofono.c b/src/modules/bluetooth/backend-ofono.c
index 33fee851a..c8109d9f9 100644
--- a/src/modules/bluetooth/backend-ofono.c
+++ b/src/modules/bluetooth/backend-ofono.c
@@ -549,6 +549,8 @@ static DBusMessage *hf_audio_agent_new_connection(DBusConnection *c, DBusMessage
if (!card || codec != HFP_AUDIO_CODEC_CVSD || card->transport->state == PA_BLUETOOTH_TRANSPORT_STATE_PLAYING) {
pa_log_warn("New audio connection invalid arguments (path=%s fd=%d, codec=%d)", path, fd, codec);
pa_assert_se(r = dbus_message_new_error(m, "org.ofono.Error.InvalidArguments", "Invalid arguments in method call"));
+ shutdown(fd, SHUT_RDWR);
+ close(fd);
return r;
}