aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/osmo-bsc_nat/bsc_nat.c
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-06-08 12:25:16 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2018-06-08 12:29:31 +0200
commit3b55a5bc77a76881fe976bcf9f1e6b4937502428 (patch)
tree8e4a3aa75604fb20be370cfd2cdd1dcac4a48265 /openbsc/src/osmo-bsc_nat/bsc_nat.c
parentdc467ca879426a0e7e2cd264765c3c8c9a624e0a (diff)
bsc-nat: forward_sccp_to_msc: Fix memleak on receive from non authenticated bsc
variable "parsed" was not being freed in this case. By calling exit2 we make sure it is freed. Change-Id: Ifd0c145ff733fdfb2f6fcb32065de99ee951d106
Diffstat (limited to 'openbsc/src/osmo-bsc_nat/bsc_nat.c')
-rw-r--r--openbsc/src/osmo-bsc_nat/bsc_nat.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c
index 928dd4c02..373ba97a9 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_nat.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c
@@ -1124,8 +1124,7 @@ static int forward_sccp_to_msc(struct bsc_connection *bsc, struct msgb *msg)
*/
if (!bsc->authenticated) {
LOGP(DNAT, LOGL_ERROR, "BSC is not authenticated.\n");
- msgb_free(msg);
- return -1;
+ goto exit2;
}