summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/hfp_hf_bluez5.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/hfp_hf_bluez5.c b/plugins/hfp_hf_bluez5.c
index c4a3f32f..2aabdd2e 100644
--- a/plugins/hfp_hf_bluez5.c
+++ b/plugins/hfp_hf_bluez5.c
@@ -323,10 +323,12 @@ static DBusMessage *profile_new_connection(DBusConnection *conn,
}
err = service_level_connection(modem, fd, HFP_VERSION_LATEST);
- if (err < 0 && err != -EINPROGRESS)
+ if (err < 0 && err != -EINPROGRESS) {
+ close(fd);
return g_dbus_create_error(msg, BLUEZ_ERROR_INTERFACE
".Rejected",
"Not enough resources");
+ }
hfp = ofono_modem_get_data(modem);
hfp->msg = dbus_message_ref(msg);