mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-26 22:30:28 +00:00
Merged revisions 298477 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ........ r298477 | tilghman | 2010-12-16 02:54:23 -0600 (Thu, 16 Dec 2010) | 8 lines Eliminate duplicates from container. (closes issue #18091) Reported by: bunny Patches: 20101006__issue18091.diff.txt uploaded by tilghman (license 14) Tested by: bunny ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@298478 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -236,6 +236,11 @@ static int dialgroup_write(struct ast_channel *chan, const char *cmd, char *data
|
||||
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user