[asterisk-commits] coreyfarrell: trunk r426808 - in /trunk: ./ apps/app_queue.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Oct 30 18:56:42 CDT 2014


Author: coreyfarrell
Date: Thu Oct 30 18:56:39 2014
New Revision: 426808

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=426808
Log:
app_queue: fix a couple leaks to struct call_queue in set_member_value

set_member_value has a couple leaks to references in the variable q
found through testsuite tests/queues/set_penalty.  Also remove the
REF_DEBUG_ONLY_QUEUES compiler declaration, this is no longer possible
with the updated REF_DEBUG code.

ASTERISK-24466 #close
Reported by: Corey Farrell
Review: https://reviewboard.asterisk.org/r/4125/
........

Merged revisions 426805 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 426806 from http://svn.asterisk.org/svn/asterisk/branches/12
........

Merged revisions 426807 from http://svn.asterisk.org/svn/asterisk/branches/13

Modified:
    trunk/   (props changed)
    trunk/apps/app_queue.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-13-merged' - no diff available.

Modified: trunk/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/trunk/apps/app_queue.c?view=diff&rev=426808&r1=426807&r2=426808
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Thu Oct 30 18:56:39 2014
@@ -113,9 +113,6 @@
 #include "asterisk/mixmonitor.h"
 #include "asterisk/core_unreal.h"
 #include "asterisk/bridge_basic.h"
-
-/* Define, to debug reference counts on queues, without debugging reference counts on queue members */
-/* #define REF_DEBUG_ONLY_QUEUES */
 
 /*!
  * \par Please read before modifying this file.
@@ -1817,7 +1814,7 @@
 	ao2_callback(queue->members, OBJ_NODATA | OBJ_MULTIPLE, queue_member_decrement_followers, &pos);
 }
 
-#ifdef REF_DEBUG_ONLY_QUEUES
+#ifdef REF_DEBUG
 #define queue_ref(q)				_queue_ref(q, "", __FILE__, __LINE__, __PRETTY_FUNCTION__)
 #define queue_unref(q)				_queue_unref(q, "", __FILE__, __LINE__, __PRETTY_FUNCTION__)
 #define queue_t_ref(q, tag)			_queue_ref(q, tag, __FILE__, __LINE__, __PRETTY_FUNCTION__)
@@ -7266,6 +7263,7 @@
 					if ((q = find_load_queue_rt_friendly(name))) {
 						foundqueue++;
 						foundinterface += set_member_value_help_members(q, interface, property, value);
+						queue_unref(q);
 					}
 				}
 			}
@@ -7276,12 +7274,14 @@
 		while ((q = ao2_t_iterator_next(&queue_iter, "Iterate through queues"))) {
 			foundqueue++;
 			foundinterface += set_member_value_help_members(q, interface, property, value);
+			queue_unref(q);
 		}
 		ao2_iterator_destroy(&queue_iter);
 	} else { /* We actually have a queuename, so we can just act on the single queue. */
 		if ((q = find_load_queue_rt_friendly(queuename))) {
 			foundqueue++;
 			foundinterface += set_member_value_help_members(q, interface, property, value);
+			queue_unref(q);
 		}
 	}
 




More information about the asterisk-commits mailing list