aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/mgcp/mgcp_protocol.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-04-24 21:02:48 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-04-25 23:02:55 +0800
commit32d4e50d469f307e6c13b86fdda66d9336f52ab6 (patch)
tree100a58ee6a55feddb77637badf0e73fe6059d5be /openbsc/src/mgcp/mgcp_protocol.c
parentdc41755fc7c092669db6a387e7e301024468183f (diff)
[mgcp] Possible memleak fix for the allowed reallocation case
When allowing to reallocate an allocated endpoint we will need to free it first. When freeing we will free the call id and other ids that we would have leaked otherwise.
Diffstat (limited to 'openbsc/src/mgcp/mgcp_protocol.c')
-rw-r--r--openbsc/src/mgcp/mgcp_protocol.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/openbsc/src/mgcp/mgcp_protocol.c b/openbsc/src/mgcp/mgcp_protocol.c
index 6d5713c1..d82bd68f 100644
--- a/openbsc/src/mgcp/mgcp_protocol.c
+++ b/openbsc/src/mgcp/mgcp_protocol.c
@@ -389,6 +389,7 @@ static struct msgb *handle_create_con(struct mgcp_config *cfg, struct msgb *msg)
if (cfg->force_realloc) {
LOGP(DMGCP, LOGL_NOTICE, "Endpoint 0x%x already allocated. Forcing realloc.\n",
ENDPOINT_NUMBER(endp));
+ mgcp_free_endp(endp);
} else {
LOGP(DMGCP, LOGL_ERROR, "Endpoint is already used. 0x%x\n",
ENDPOINT_NUMBER(endp));