pespin has uploaded this change for review.
bts: free MS object after allocating it if no tbf becomes attached
Since no TBF is attached, it means it won't be freed automatically since
the refcounting is never increased, and hence it needs to be freed
manually.
In any case, it makes no sense to keep the MS object around since it has
no relevant information at that point in time yet.
Related: OS#6002
Change-Id: I2088a7ddd76fe9157b6626ef96ae4315e88779ea
---
M src/bts.cpp
1 file changed, 18 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/75/32375/1
diff --git a/src/bts.cpp b/src/bts.cpp
index 40541c5..c9a078a 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -1010,6 +1010,8 @@
ms_set_egprs_ms_class(ms, chan_req.egprs_mslot_class);
tbf = ms_new_ul_tbf_assigned_agch(ms);
if (!tbf) {
+ /* Release the MS just allocated since no TBF was attached */
+ talloc_free(ms);
/* Send RR Immediate Assignment Reject */
rc = -EBUSY;
goto send_imm_ass_rej;
To view, visit change 32375. To unsubscribe, or for help writing mail filters, visit settings.