From 53f797305f98735e325d067bdefc3173997eeadc Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sat, 24 Apr 2010 21:02:48 +0800 Subject: [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. --- openbsc/src/mgcp/mgcp_protocol.c | 1 + 1 file changed, 1 insertion(+) (limited to 'openbsc') diff --git a/openbsc/src/mgcp/mgcp_protocol.c b/openbsc/src/mgcp/mgcp_protocol.c index 6d5713c13..d82bd68f9 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)); -- cgit v1.2.3