aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-06-29 18:57:58 +0200
committerHarald Welte <laforge@gnumonks.org>2011-06-29 18:57:58 +0200
commit40e820d882a0401c99cb70f684ed5dbbb6a63adb (patch)
tree35be3ee74143e3f5c79d58751cc32f297f92336e
parentae5dfdc416c03221b0b747883fd9c1fd54db281e (diff)
OML: fix memory leaks by centralized msgb_free() for rx msgs
-rw-r--r--src/common/oml.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/common/oml.c b/src/common/oml.c
index f4b0f15..2636332 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -717,7 +717,6 @@ static int down_fom(struct gsm_bts *bts, struct msgb *msg)
if (msgb_l2len(msg) < sizeof(*foh)) {
LOGP(DOML, LOGL_NOTICE, "Formatted O&M message too short\n");
- msgb_free(msg);
return -EIO;
}
@@ -822,7 +821,6 @@ static int down_mom(struct gsm_bts *bts, struct msgb *msg)
if (msgb_l2len(msg) < sizeof(*foh)) {
LOGP(DOML, LOGL_NOTICE, "Manufacturer O&M message too short\n");
- msgb_free(msg);
return -EIO;
}
@@ -879,7 +877,6 @@ int down_oml(struct gsm_bts *bts, struct msgb *msg)
case ABIS_OM_MDISC_FOM:
if (msgb_l2len(msg) < sizeof(*oh)) {
LOGP(DOML, LOGL_NOTICE, "Formatted O&M message too short\n");
- msgb_free(msg);
ret = -EIO;
break;
}
@@ -888,7 +885,6 @@ int down_oml(struct gsm_bts *bts, struct msgb *msg)
case ABIS_OM_MDISC_MANUF:
if (msgb_l2len(msg) < sizeof(*oh)) {
LOGP(DOML, LOGL_NOTICE, "Manufacturer O&M message too short\n");
- msgb_free(msg);
ret = -EIO;
break;
}
@@ -897,10 +893,11 @@ int down_oml(struct gsm_bts *bts, struct msgb *msg)
default:
LOGP(DOML, LOGL_NOTICE, "unknown OML msg_discr 0x%02x\n",
oh->mdisc);
- msgb_free(msg);
ret = -EINVAL;
}
+ msgb_free(msg);
+
return ret;
}