gsm_04_11: Speculative leak fix for the SMS...
diff --git a/openbsc/src/gsm_04_11.c b/openbsc/src/gsm_04_11.c
index 75ce427..3d7f7e1 100644
--- a/openbsc/src/gsm_04_11.c
+++ b/openbsc/src/gsm_04_11.c
@@ -802,8 +802,6 @@
 	sms_free(sms);
 	trans->sms.sms = NULL;
 
-	//trans_free(trans);
-
 	return 0;
 }
 
@@ -1168,6 +1166,12 @@
 
 void _gsm411_sms_trans_free(struct gsm_trans *trans)
 {
+	if (trans->sms.sms) {
+		LOGP(DSMS, LOGL_ERROR, "Transaction contains SMS.\n");
+		sms_free(trans->sms.sms);
+		trans->sms.sms = NULL;
+	}
+
 	bsc_del_timer(&trans->sms.cp_timer);
 }