diff options
author | Mark Michelson <mmichelson@digium.com> | 2013-05-10 20:50:53 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2013-05-10 20:50:53 +0000 |
commit | 85fda4ca8716657cfecf7226a358e834db805204 (patch) | |
tree | d94d0e0cab906ded8ec2ddfd8a9ca6bed9e5612c | |
parent | 8f05ed46feef44c005dc65f5abeb434813a04399 (diff) |
Fix memory leak in pbx_dundi
pbx_dundi added an io context without removing
it. This caused a memory leak when the module was
unloaded.
(closes ASTERISK-21718)
Reported by Corey Farrell
Patches:
pbx_dundi-ast_io_remove.patch uploaded by Corey Farrell (License #5909)
........
Merged revisions 388376 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 388378 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@388380 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | pbx/pbx_dundi.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c index 6e5dc1674..3c9704758 100644 --- a/pbx/pbx_dundi.c +++ b/pbx/pbx_dundi.c @@ -2178,7 +2178,7 @@ static void *network_thread(void *ignore) from the network, and queue them for delivery to the channels */ int res; /* Establish I/O callback for socket read */ - ast_io_add(io, netsocket, socket_read, AST_IO_IN, NULL); + int *socket_read_id = ast_io_add(io, netsocket, socket_read, AST_IO_IN, NULL); while (!dundi_shutdown) { res = ast_sched_wait(sched); @@ -2193,6 +2193,7 @@ static void *network_thread(void *ignore) check_password(); } + ast_io_remove(io, socket_read_id); netthreadid = AST_PTHREADT_NULL; return NULL; |