This patch fix an unusual scenario, service_level_connection() fails if
GIOChannel or GAtChat memory allocation fails.
---
plugins/hfp_hf_bluez5.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/plugins/hfp_hf_bluez5.c b/plugins/hfp_hf_bluez5.c
index 28c57c3..ced5a20 100644
--- a/plugins/hfp_hf_bluez5.c
+++ b/plugins/hfp_hf_bluez5.c
@@ -369,10 +369,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);
--
1.7.11.7
_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono