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