nimble/host: Fix txom leaks in ble_sm_tx and ble_l2cap_sig_tx

Those functions are expected to always consume txom.
This commit is contained in:
Szymon Janc
2021-08-24 11:22:34 +02:00
parent e49a145533
commit 7c581b0734
2 changed files with 5 additions and 0 deletions
+3
View File
@@ -21,6 +21,7 @@
#include "ble_hs_priv.h"
#if NIMBLE_BLE_CONNECT
/* this function consumes tx os_mbuf */
int
ble_l2cap_sig_tx(uint16_t conn_handle, struct os_mbuf *txom)
{
@@ -33,6 +34,8 @@ ble_l2cap_sig_tx(uint16_t conn_handle, struct os_mbuf *txom)
&conn, &chan);
if (rc == 0) {
rc = ble_l2cap_tx(conn, chan, txom);
} else {
os_mbuf_free_chain(txom);
}
ble_hs_unlock();
+2
View File
@@ -63,6 +63,8 @@ ble_sm_tx(uint16_t conn_handle, struct os_mbuf *txom)
&conn, &chan);
if (rc == 0) {
rc = ble_l2cap_tx(conn, chan, txom);
} else {
os_mbuf_free_chain(txom);
}
return rc;