From 3b55a5bc77a76881fe976bcf9f1e6b4937502428 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Fri, 8 Jun 2018 12:25:16 +0200 Subject: 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 --- openbsc/src/osmo-bsc_nat/bsc_nat.c | 3 +-- 1 file changed, 1 insertion(+), 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; } -- cgit v1.2.3