aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-10-18 21:36:01 +0200
committerHarald Welte <laforge@gnumonks.org>2016-10-18 21:36:01 +0200
commit4a92d0b9b9f43ef15e5af64ace1c212609de4af4 (patch)
treedc84a4aa6efd35812f2859a3bd05d3ce2b8ac568 /src
parentafb6d3990816f1290fc95fceafe1eac53e52bdb2 (diff)
e1_recorder: Fix msgb memory leaks in absence of a mirror port
Diffstat (limited to 'src')
-rw-r--r--src/e1_recorder.c7
1 files changed, 5 insertions, 2 deletions
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,