libosmo-mgcp: e1: fix memleaks in e1_recv_cb()

Change-Id: I4be9e6d09b34e792f24c9f09d19dce15b9dfbe3f
Fixes: OS#5533
This commit is contained in:
Vadim Yanitskiy 2022-04-18 02:29:37 +03:00
parent 1c69fb0f14
commit 0b6faa4521
1 changed files with 4 additions and 0 deletions

View File

@ -338,6 +338,7 @@ static void e1_recv_cb(struct e1inp_ts *ts, struct msgb *msg)
trunk = mgcp_trunk_by_line_num(cfg, ts->line->num);
if (!trunk) {
LOGP(DE1, LOGL_ERROR, "E1-RX: unable to find a trunk for E1-line %u!\n", ts->line->num);
msgb_free(msg);
return;
}
@ -359,6 +360,9 @@ static void e1_recv_cb(struct e1inp_ts *ts, struct msgb *msg)
/* Trigger sending of pending E1 traffic */
e1_send(ts, trunk);
/* e1inp_rx_ts() does not free() msgb */
msgb_free(msg);
}
static int e1_init(struct mgcp_trunk *trunk, uint8_t ts_nr)