summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/scXp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/scXp.c b/src/scXp.c
index 0cc1ac4..c39daf7 100644
--- a/src/scXp.c
+++ b/src/scXp.c
@@ -48,7 +48,10 @@ int tcap_tco_n_notice_ind(struct tcap_transport_entity *se);
static int tcap_tp_udp_unitdata_req(struct tcap_transport_entity *se, struct msgb *msg)
{
- return osmo_wqueue_enqueue(&se->udp.write_queue, msg);
+ int rc = osmo_wqueue_enqueue(&se->udp.write_queue, msg);
+ if (rc < 0)
+ msgb_free(msg);
+ return rc;
}
/* called by the write queue / FD magic in case we need to write a message */
@@ -138,6 +141,8 @@ int tcap_scXp_n_unitdata_req(struct tcap_transport_entity *se, struct msgb *msg)
switch (se->type) {
case SCXP_T_UDP:
rc = osmo_wqueue_enqueue(&se->udp.write_queue, msg);
+ if (rc < 0)
+ msgb_free(msg);
break;
}