Change in osmo-msc[master]: libmsc/gsm_04_11.c: cosmetic: restructure gsm411_mm_send()

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Sat May 11 21:06:43 UTC 2019


Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/14001


Change subject: libmsc/gsm_04_11.c: cosmetic: restructure gsm411_mm_send()
......................................................................

libmsc/gsm_04_11.c: cosmetic: restructure gsm411_mm_send()

Change-Id: I22e99f40ab2252a0b716969091e4d24b3b4268a2
---
M src/libmsc/gsm_04_11.c
1 file changed, 2 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/01/14001/1

diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c
index cc9ce18..c5c3036 100644
--- a/src/libmsc/gsm_04_11.c
+++ b/src/libmsc/gsm_04_11.c
@@ -216,22 +216,20 @@
 	switch (msg_type) {
 	case GSM411_MMSMS_EST_REQ:
 		rc = gsm411_mmsms_est_req(trans);
-		msgb_free(msg); /* upper layer does not free msg */
 		break;
 	case GSM411_MMSMS_DATA_REQ:
 		rc = gsm411_cp_sendmsg(msg, trans, cp_msg_type);
-		break;
+		return rc; /* gsm411_cp_sendmsg() takes msg ownership */
 	case GSM411_MMSMS_REL_REQ:
 		LOG_TRANS(trans, LOGL_DEBUG, "Got MMSMS_REL_REQ, destroying transaction.\n");
-		msgb_free(msg);
 		trans_free(trans);
 		break;
 	default:
 		LOG_TRANS(trans, LOGL_NOTICE, "Unhandled MMCCSMS msg 0x%x\n", msg_type);
-		msgb_free(msg);
 		rc = -EINVAL;
 	}
 
+	msgb_free(msg);
 	return rc;
 }
 

-- 
To view, visit https://gerrit.osmocom.org/14001
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I22e99f40ab2252a0b716969091e4d24b3b4268a2
Gerrit-Change-Number: 14001
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190511/240df3c8/attachment.html>


More information about the gerrit-log mailing list