From 387304c41d36ca8ce84910c2c90b2f38158b35e0 Mon Sep 17 00:00:00 2001 From: Eric Date: Sun, 11 Jul 2021 02:48:31 +0200 Subject: 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. Closes: OS#5185 Change-Id: Id8584b99f30f2db602d4d129e4114821697272ab --- src/m3ua.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 @@ int m3ua_rx_msg(struct osmo_ss7_asp *asp, struct msgb *msg) 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 @@ void m3ua_tx_snm_available(struct osmo_ss7_asp *asp, const uint32_t *rctx, unsig 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 @@ void m3ua_tx_dupu(struct osmo_ss7_asp *asp, const uint32_t *rctx, unsigned int n { 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 */ -- cgit v1.2.3