[asterisk-commits] kmoore: trunk r382555 - /trunk/main/threadpool.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Mar 6 18:05:20 CST 2013


Author: kmoore
Date: Wed Mar  6 18:05:16 2013
New Revision: 382555

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=382555
Log:
Fix ref leak in threadpool.c

If ast_threadpool_set_size with a size equal to the current size, a
reference to a set_size_data structure would be leaked.

Modified:
    trunk/main/threadpool.c

Modified: trunk/main/threadpool.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/threadpool.c?view=diff&rev=382555&r1=382554&r2=382555
==============================================================================
--- trunk/main/threadpool.c (original)
+++ trunk/main/threadpool.c Wed Mar  6 18:05:16 2013
@@ -792,7 +792,7 @@
  */
 static int queued_set_size(void *data)
 {
-	struct set_size_data *ssd = data;
+	RAII_VAR(struct set_size_data *, ssd, data, ao2_cleanup);
 	struct ast_threadpool *pool = ssd->pool;
 	unsigned int num_threads = ssd->size;
 
@@ -813,7 +813,6 @@
 	}
 
 	threadpool_send_state_changed(pool);
-	ao2_ref(ssd, -1);
 	return 0;
 }
 




More information about the asterisk-commits mailing list