Change in osmo-trx[master]: radioInterfaceMulti: Fix memory leak upon close()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Fri Jan 15 15:30:05 UTC 2021


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-trx/+/22211 )


Change subject: radioInterfaceMulti: Fix memory leak upon close()
......................................................................

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
---
M Transceiver52M/radioInterfaceMulti.cpp
1 file changed, 4 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/11/22211/1

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 @@
 	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);

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/22211
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: Ia4f9d4e47caa86ada98054763573e652d281992c
Gerrit-Change-Number: 22211
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210115/3823e6ac/attachment.htm>


More information about the gerrit-log mailing list