mirror of git://git.sysmocom.de/ofono
hfp_hf_bluez5: Fix missing fd close
This patch fix an unusual scenario, service_level_connection() fails if GIOChannel or GAtChat memory allocation fails.
This commit is contained in:
parent
b6f92d3074
commit
9496fe8e70
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue