aboutsummaryrefslogtreecommitdiffstats
path: root/src/sccp_user.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-07-11 05:04:44 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2020-01-07 18:18:46 +0100
commitffb248dd787eb854e049d990afc40f0e604268f2 (patch)
tree0991f0cdd9cf7da4ddb99f4dd9340b94a91eff8b /src/sccp_user.c
parent5e4643f4bc76a1437621348550b5b2a603e2179b (diff)
fix memleaks in mtp_user_prim_cb()
After dispatching to scrc_rx_mtp_xfer_ind_xua(), free the xua_msg. Do not free the xua_msg in any of the code paths triggered within scrc_rx_mtp_xfer_ind_xua(), i.e. remove xua_msg_free() from: sccp_scoc_rx_from_scrc() +->sccp_scoc_rx_unass_local_ref() +->tx_coerr_from_xua() +->tx_relco_from_xua() Before this, some code paths would free the xua_msg, while most code paths would not, causing mem leaks. Change-Id: I72b3c6a6f57ba32d9ba191af33b4b236492174e0
Diffstat (limited to 'src/sccp_user.c')
-rw-r--r--src/sccp_user.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/sccp_user.c b/src/sccp_user.c
index 929445f..49cc212 100644
--- a/src/sccp_user.c
+++ b/src/sccp_user.c
@@ -174,6 +174,7 @@ static int mtp_user_prim_cb(struct osmo_prim_hdr *oph, void *ctx)
xua->mtp = omp->u.transfer;
/* hand this primitive into SCCP via the SCRC code */
rc = scrc_rx_mtp_xfer_ind_xua(inst, xua);
+ xua_msg_free(xua);
break;
default:
LOGP(DLSCCP, LOGL_ERROR, "Unknown primitive %u:%u receivd\n",