From be3fdc2c6e11149a15bd321e65d3b7b06308f621 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sat, 1 May 2010 10:31:53 +0800 Subject: nat: Fix memory leak... in MGCP forwarding The code needs to be refactored but this is fixing the leak for now. We used to forward everything to the BSC but now we handle the DLCX locally and this means we need to clear the patched message. We should refactor it to not generate the patched msg until a lot later. --- openbsc/src/nat/bsc_mgcp_utils.c | 1 + 1 file changed, 1 insertion(+) diff --git a/openbsc/src/nat/bsc_mgcp_utils.c b/openbsc/src/nat/bsc_mgcp_utils.c index 6e28095d0..5d77c2bd9 100644 --- a/openbsc/src/nat/bsc_mgcp_utils.c +++ b/openbsc/src/nat/bsc_mgcp_utils.c @@ -256,6 +256,7 @@ int bsc_mgcp_policy_cb(struct mgcp_config *cfg, int endpoint, int state, const c return MGCP_POLICY_DEFER; } else if (state == MGCP_ENDP_DLCX) { /* we will free the endpoint now and send a DLCX to the BSC */ + msgb_free(bsc_msg); bsc_mgcp_dlcx(sccp); return MGCP_POLICY_CONT; } else { -- cgit v1.2.3