introduce cache of 6 last recently received measurement reports for each lchan
diff --git a/openbsc/src/chan_alloc.c b/openbsc/src/chan_alloc.c
index 2f0d7b9..0a29847 100644
--- a/openbsc/src/chan_alloc.c
+++ b/openbsc/src/chan_alloc.c
@@ -235,6 +235,8 @@
 /* Free a logical channel */
 void lchan_free(struct gsm_lchan *lchan)
 {
+	int i;
+
 	lchan->type = GSM_LCHAN_NONE;
 	if (lchan->subscr) {
 		subscr_put(lchan->subscr);
@@ -250,6 +252,13 @@
 	/* stop the timer */
 	bsc_del_timer(&lchan->release_timer);
 
+	/* clear cached measuement reports */
+	lchan->meas_rep_idx = 0;
+	for (i = 0; i < ARRAY_SIZE(lchan->meas_rep); i++) {
+		lchan->meas_rep[i].flags = 0;
+		lchan->meas_rep[i].nr = 0;
+	}
+
 	/* FIXME: ts_free() the timeslot, if we're the last logical
 	 * channel using it */
 }