aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_mgcp.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-28 21:38:26 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-28 21:38:26 +0000
commit1268965df1233bc1be6c1f0328d794a2c5b3c0f0 (patch)
tree6cf112cbe7a64fc07186d25badd1a12690db3cea /channels/chan_mgcp.c
parentc10d849458deef36e51cde0ae8fd3036e083bbd0 (diff)
Only re-add the io port if it was closed, otherwise reload causes a memory
leak. (closes issue #13785) Reported by: eliel Patches: chan_mgcp.c.patch uploaded by eliel (license 64) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@152442 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_mgcp.c')
-rw-r--r--channels/chan_mgcp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c
index 644e7b787..083c0e3e2 100644
--- a/channels/chan_mgcp.c
+++ b/channels/chan_mgcp.c
@@ -3431,8 +3431,9 @@ static void *do_monitor(void *data)
ast_verb(1, "Reloading MGCP\n");
reload_config(1);
/* Add an I/O event to our UDP socket */
- if (mgcpsock > -1)
+ if (mgcpsock > -1 && !mgcpsock_read_id) {
mgcpsock_read_id = ast_io_add(io, mgcpsock, mgcpsock_read, AST_IO_IN, NULL);
+ }
}
/* Check for interfaces needing to be killed */