[asterisk-commits] coreyfarrell: branch 12 r426806 - in /branches/12: ./ apps/app_queue.c

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


Author: coreyfarrell
Date: Thu Oct 30 18:54:36 2014
New Revision: 426806

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

Modified:
    branches/12/   (props changed)
    branches/12/apps/app_queue.c

Propchange: branches/12/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Modified: branches/12/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/apps/app_queue.c?view=diff&rev=426806&r1=426805&r2=426806
==============================================================================
--- branches/12/apps/app_queue.c (original)
+++ branches/12/apps/app_queue.c Thu Oct 30 18:54:36 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.
@@ -1773,7 +1770,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__)
@@ -7123,6 +7120,7 @@
 					if ((q = find_load_queue_rt_friendly(name))) {
 						foundqueue++;
 						foundinterface += set_member_value_help_members(q, interface, property, value);
+						queue_unref(q);
 					}
 				}
 			}
@@ -7133,12 +7131,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