[asterisk-commits] tilghman: branch 1.6.2 r298477 - /branches/1.6.2/funcs/func_dialgroup.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Dec 16 08:54:27 UTC 2010


Author: tilghman
Date: Thu Dec 16 02:54:23 2010
New Revision: 298477

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=298477
Log:
Eliminate duplicates from container.

(closes issue #18091)
 Reported by: bunny
 Patches: 
       20101006__issue18091.diff.txt uploaded by tilghman (license 14)
 Tested by: bunny

Modified:
    branches/1.6.2/funcs/func_dialgroup.c

Modified: branches/1.6.2/funcs/func_dialgroup.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/funcs/func_dialgroup.c?view=diff&rev=298477&r1=298476&r2=298477
==============================================================================
--- branches/1.6.2/funcs/func_dialgroup.c (original)
+++ branches/1.6.2/funcs/func_dialgroup.c Thu Dec 16 02:54:23 2010
@@ -236,6 +236,11 @@
 
 	if (strcasecmp(args.op, "add") == 0) {
 		for (j = 0; j < inter.argc; j++) {
+			/* Eliminate duplicates */
+			if ((entry = ao2_find(grhead->entries, inter.faces[j], 0))) {
+				ao2_ref(entry, -1);
+				continue;
+			}
 			if ((entry = ao2_alloc(sizeof(*entry), NULL))) {
 				ast_copy_string(entry->name, inter.faces[j], sizeof(entry->name));
 				ao2_link(grhead->entries, entry);




More information about the asterisk-commits mailing list