aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-sysmo/l1_if.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2013-01-22 15:36:49 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2013-02-27 09:07:18 +0100
commit5e46e4b4880f01eed508d49b66d96c1f7475ab89 (patch)
treeffd65c5aba632115bee436e44a47c6882a487cb8 /src/osmo-bts-sysmo/l1_if.c
parent3d383c22c7d1d290e498c7db652e7d1888245e43 (diff)
sysmobts: Fix a memory leak when no callback is set
The TxPower handled used to call the requestion function without a callback. In that case the msgb is leaked. The code still allows the callback to be NULL so we will just delete the message in that case.
Diffstat (limited to 'src/osmo-bts-sysmo/l1_if.c')
-rw-r--r--src/osmo-bts-sysmo/l1_if.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index 7040a5fe..d848f7de 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -882,8 +882,10 @@ int l1if_handle_l1prim(int wq, struct femtol1_hdl *fl1h, struct msgb *msg)
llist_del(&wlc->list);
if (wlc->cb)
rc = wlc->cb(fl1h->priv, msg);
- else
+ else {
rc = 0;
+ msgb_free(msg);
+ }
release_wlc(wlc);
return rc;
}
@@ -910,8 +912,10 @@ int l1if_handle_sysprim(struct femtol1_hdl *fl1h, struct msgb *msg)
llist_del(&wlc->list);
if (wlc->cb)
rc = wlc->cb(fl1h->priv, msg);
- else
+ else {
rc = 0;
+ msgb_free(msg);
+ }
release_wlc(wlc);
return rc;
}