mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-09-13 20:50:00 +00:00
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:
@@ -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();
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user