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/.

laforge gerrit-no-reply at lists.osmocom.org
Sun Jan 17 17:18:49 UTC 2021


laforge has submitted this change. ( 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(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



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: 2
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210117/7732d4c7/attachment.htm>


More information about the gerrit-log mailing list