[asterisk-commits] mmichelson: branch 1.8 r388376 - /branches/1.8/pbx/pbx_dundi.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri May 10 15:28:31 CDT 2013


Author: mmichelson
Date: Fri May 10 15:28:29 2013
New Revision: 388376

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=388376
Log:
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)


Modified:
    branches/1.8/pbx/pbx_dundi.c

Modified: branches/1.8/pbx/pbx_dundi.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/pbx/pbx_dundi.c?view=diff&rev=388376&r1=388375&r2=388376
==============================================================================
--- branches/1.8/pbx/pbx_dundi.c (original)
+++ branches/1.8/pbx/pbx_dundi.c Fri May 10 15:28:29 2013
@@ -2162,7 +2162,7 @@
 	   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);
@@ -2177,6 +2177,7 @@
 		check_password();
 	}
 
+	ast_io_remove(io, socket_read_id);
 	netthreadid = AST_PTHREADT_NULL;
 
 	return NULL;




More information about the asterisk-commits mailing list