Bluetooth: Fix buffer leak in bt_conn_send
Since bt_conn_send doesn't currently return an error code it must be assumed to consume the buffer no matter what. The only failure condition is the "not connected" case, so make sure the buffer is unreffed there. Change-Id: I30e9a81d6f801a67d90ab59c1040b6f55261e71c Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
b9d13664ab
commit
f6bfb4377e
1 changed files with 1 additions and 0 deletions
|
@ -332,6 +332,7 @@ void bt_conn_send(struct bt_conn *conn, struct net_buf *buf)
|
|||
|
||||
if (conn->state != BT_CONN_CONNECTED) {
|
||||
BT_ERR("not connected!\n");
|
||||
net_buf_unref(buf);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue