aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-08-12 18:31:22 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2019-08-12 18:33:39 +0200
commit788863cda53298c24110d0fe0f8cd3309cdec747 (patch)
treea179fee5dd06897597ec42cea4c1f0f897a0b1ab
parent404d9b8bbaf8f06afa0ccba6a8a5e96eccf7a553 (diff)
gprs_sgsn.c: Warn upon llme free unexpected scenarios
May be useful to detect unexpected conditions which could end up in memory leaks. Related: OS#3957 Change-Id: I0d175501083ce458ff1c07ad38761d2cbf4ea470
-rw-r--r--src/gprs/gprs_sgsn.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gprs/gprs_sgsn.c b/src/gprs/gprs_sgsn.c
index e01bc5c..8f1e54a 100644
--- a/src/gprs/gprs_sgsn.c
+++ b/src/gprs/gprs_sgsn.c
@@ -362,7 +362,9 @@ void sgsn_mm_ctx_cleanup_free(struct sgsn_mm_ctx *mm)
if (llme) {
/* TLLI unassignment, must be called after sgsn_mm_ctx_free */
- gprs_llgmm_assign(llme, tlli, TLLI_UNASSIGNED);
+ OSMO_ASSERT(llme->tlli == tlli);
+ if (gprs_llgmm_unassign(llme) < 0)
+ LOGMMCTXP(LOGL_ERROR, mm, "gprs_llgmm_unassign failed, llme not freed!\n");
}
}