Change in libosmo-sccp[master]: m3ua: fix leaky usage of m3ua_tx_xua_asp

Hoernchen gerrit-no-reply at lists.osmocom.org
Sun Jul 11 19:09:37 UTC 2021


Hoernchen has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/24909 )


Change subject: m3ua: fix leaky usage of m3ua_tx_xua_asp
......................................................................

m3ua: fix leaky usage of m3ua_tx_xua_asp

m3ua_tx_xua_asp will at some point convert the xua msg to a msgb by
copying and then send it, the xua msg still needs to be freed by the
caller.

Change-Id: Id8584b99f30f2db602d4d129e4114821697272ab
---
M src/m3ua.c
1 file changed, 5 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/09/24909/1

diff --git a/src/m3ua.c b/src/m3ua.c
index e2db6c1..4583683 100644
--- a/src/m3ua.c
+++ b/src/m3ua.c
@@ -752,8 +752,10 @@
 		err = m3ua_gen_error_msg(rc, msg);
 
 out:
-	if (err)
+	if (err) {
 		m3ua_tx_xua_asp(asp, err);
+		xua_msg_free(err);
+	}
 
 	xua_msg_free(xua);
 
@@ -856,6 +858,7 @@
 		xua = m3ua_encode_duna(rctx, num_rctx, aff_pc, num_aff_pc, info_string);
 
 	m3ua_tx_xua_asp(asp, xua);
+	xua_msg_free(xua);
 }
 
 /*! Transmit SSNM DUPU message indicating user unavailability.
@@ -871,6 +874,7 @@
 {
 	struct xua_msg *xua = m3ua_encode_dupu(rctx, num_rctx, dpc, user, cause, info_str);
 	m3ua_tx_xua_asp(asp, xua);
+	xua_msg_free(xua);
 }
 
 /* received SNM message on ASP side */

-- 
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/24909
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: Id8584b99f30f2db602d4d129e4114821697272ab
Gerrit-Change-Number: 24909
Gerrit-PatchSet: 1
Gerrit-Owner: Hoernchen <ewild at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210711/cf6c1b62/attachment.htm>


More information about the gerrit-log mailing list