From 4a92d0b9b9f43ef15e5af64ace1c212609de4af4 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Tue, 18 Oct 2016 21:36:01 +0200 Subject: e1_recorder: Fix msgb memory leaks in absence of a mirror port --- src/e1_recorder.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/e1_recorder.c b/src/e1_recorder.c index d8dccfe..868d95d 100644 --- a/src/e1_recorder.c +++ b/src/e1_recorder.c @@ -40,12 +40,15 @@ void e1ts_raw_recv(struct e1inp_ts *ts, struct msgb *msg) e1inp_line_find(rline->mirror.line_nr); struct e1inp_ts *other_ts; other_ts = &other_line->ts[ts->num-1]; - if (!other_ts) + if (!other_ts) { + msgb_free(msg); return; + } /* forward data to destination line */ OSMO_ASSERT(other_ts->type == ts->type); msgb_enqueue(&other_ts->raw.tx_queue, msg); - } + } else + msgb_free(msg); } static int inp_sig_cb(unsigned int subsys, unsigned int signal, -- cgit v1.2.3