aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2021-01-15 16:28:50 +0100
committerlaforge <laforge@osmocom.org>2021-01-17 17:18:49 +0000
commitfca503d0b42e4e0d94724ecdfc1ee6e76c76675f (patch)
treea68f960a466c3a04a5e9a05451c5cf5649795d3c
parente8edd1fcaec8e159b2c68bf1452616fe9e7c144b (diff)
radioInterfaceMulti: Fix memory leak upon close()
The leak was reported by ASan. Direct leak of 48 byte(s) in 1 object(s) allocated from: #0 0x7fd9c9c29f41 in operator new(unsigned long) /build/gcc/src/gcc/libsanitizer/asan/asan_new_delete.cpp:99 #1 0x55bd63ae2364 in RadioInterfaceMulti::init(int) /git/osmo-trx/Transceiver52M/radioInterfaceMulti.cpp:209 #2 0x55bd63a9c6d2 in makeRadioInterface(trx_ctx*, RadioDevice*, int) /git/osmo-trx/Transceiver52M/osmo-trx.cpp:115 #3 0x55bd63a9f663 in trx_start /git/osmo-trx/Transceiver52M/osmo-trx.cpp:600 #4 0x55bd63a9fd6f in main /git/osmo-trx/Transceiver52M/osmo-trx.cpp:695 #5 0x7fd9c7910151 in __libc_start_main (/usr/lib/libc.so.6+0x28151) Change-Id: Ia4f9d4e47caa86ada98054763573e652d281992c
-rw-r--r--Transceiver52M/radioInterfaceMulti.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Transceiver52M/radioInterfaceMulti.cpp b/Transceiver52M/radioInterfaceMulti.cpp
index 465fd41..eaf0886 100644
--- a/Transceiver52M/radioInterfaceMulti.cpp
+++ b/Transceiver52M/radioInterfaceMulti.cpp
@@ -70,6 +70,10 @@ void RadioInterfaceMulti::close()
channelizer = NULL;
synthesis = NULL;
+
+ for (std::vector<signalVector*>::iterator it = history.begin(); it != history.end(); ++it)
+ delete *it;
+
mReceiveFIFO.resize(0);
powerScaling.resize(0);
history.resize(0);