summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Gix <brian.gix@intel.com>2021-05-19 12:00:45 -0700
committerBrian Gix <brian.gix@intel.com>2021-05-19 12:54:40 -0700
commit2058aadd7607a3c259e6c63c735c8b45640f0b75 (patch)
treee5a65824611b5ea00aab060c2db8869d89ff393b
parent9260107b158ddd9677ccfe1c7968f62eb988fa92 (diff)
downloadbluez-2058aadd7607a3c259e6c63c735c8b45640f0b75.tar.gz
mesh: Fix race condition memory leak
This is a minor fix of a memory leak triggered on process exit if proceess has been killed right after requesting an outbound advertisement be sent. It is harmless, but will cause an occasional static analysis failure.
-rw-r--r--mesh/mesh-io-generic.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mesh/mesh-io-generic.c b/mesh/mesh-io-generic.c
index 4eb7f27ce..6c0b8f0fd 100644
--- a/mesh/mesh-io-generic.c
+++ b/mesh/mesh-io-generic.c
@@ -462,7 +462,9 @@ static bool dev_destroy(struct mesh_io *io)
bt_hci_unref(pvt->hci);
l_timeout_remove(pvt->tx_timeout);
l_queue_destroy(pvt->rx_regs, l_free);
+ l_queue_remove_if(pvt->tx_pkts, simple_match, pvt->tx);
l_queue_destroy(pvt->tx_pkts, l_free);
+ l_free(pvt->tx);
l_free(pvt);
io->pvt = NULL;