pespin has submitted this change. (
https://gerrit.osmocom.org/c/osmo-bsc/+/38082?usp=email )
Change subject: bts: Make sure bts_location entries in bts->loc_list are freed
......................................................................
bts: Make sure bts_location entries in bts->loc_list are freed
This went unnoticed because so far there's not clear way to free a BTS,
eg. through VTY.
Change-Id: I4de3d56a4f1f6bd1fe880b72cdd384c2398dabc9
---
M include/osmocom/bsc/bts.h
M src/osmo-bsc/bts.c
M src/osmo-bsc/bts_ctrl.c
3 files changed, 4 insertions(+), 2 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, but someone else must approve
fixeria: Looks good to me, approved
diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h
index a8680d8..38e675a 100644
--- a/include/osmocom/bsc/bts.h
+++ b/include/osmocom/bsc/bts.h
@@ -337,7 +337,7 @@
/* list header in net->bts_list */
struct llist_head list;
- /* Geographical location of the BTS */
+ /* Geographical location of the BTS, head list of "struct bts_location" */
struct llist_head loc_list;
/* number of this BTS in network */
diff --git a/src/osmo-bsc/bts.c b/src/osmo-bsc/bts.c
index 260e24e..0d33427 100644
--- a/src/osmo-bsc/bts.c
+++ b/src/osmo-bsc/bts.c
@@ -156,6 +156,8 @@
static int gsm_bts_talloc_destructor(struct gsm_bts *bts)
{
+ /* Entries in bts->loc_list are freed by talloc recursively, no need to free them
here. */
+
paging_destructor(bts);
bts_setup_ramp_remove(bts);
diff --git a/src/osmo-bsc/bts_ctrl.c b/src/osmo-bsc/bts_ctrl.c
index 48b1b8a..76806f4 100644
--- a/src/osmo-bsc/bts_ctrl.c
+++ b/src/osmo-bsc/bts_ctrl.c
@@ -169,7 +169,7 @@
return CTRL_CMD_ERROR;
}
- curloc = talloc_zero(tall_bsc_ctx, struct bts_location);
+ curloc = talloc_zero(bts, struct bts_location);
if (!curloc) {
talloc_free(tmp);
goto oom;
--
To view, visit
https://gerrit.osmocom.org/c/osmo-bsc/+/38082?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I4de3d56a4f1f6bd1fe880b72cdd384c2398dabc9
Gerrit-Change-Number: 38082
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>