diff options
author | automerge <automerge@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-06-13 19:28:07 +0000 |
---|---|---|
committer | automerge <automerge@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-06-13 19:28:07 +0000 |
commit | ac6c075c461269f935a1ac1397dfba8caa865bff (patch) | |
tree | d6bd387991bea990e6bb0c63b316b45f6045d533 | |
parent | e40dc5a8419b2c69ff5045fa25850f2aac4e3fa2 (diff) |
automerge commit
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2-netsec@69180 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | app.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -1047,12 +1047,16 @@ int ast_app_group_set_channel(struct ast_channel *chan, char *data) len += strlen(category) + 1; AST_LIST_LOCK(&groups); - AST_LIST_TRAVERSE(&groups, gi, list) { - if (gi->chan == chan && !strcasecmp(gi->group, group) && (ast_strlen_zero(category) || (!ast_strlen_zero(gi->category) && !strcasecmp(gi->category, category)))) + AST_LIST_TRAVERSE_SAFE_BEGIN(&groups, gi, list) { + if ((gi->chan == chan) && ((ast_strlen_zero(category) && ast_strlen_zero(gi->category)) || (!ast_strlen_zero(gi->category) && !strcasecmp(gi->category, category)))) { + AST_LIST_REMOVE_CURRENT(&groups, list); + free(gi); break; + } } + AST_LIST_TRAVERSE_SAFE_END - if (!gi && (gi = calloc(1, len))) { + if ((gi = calloc(1, len))) { gi->chan = chan; gi->group = (char *) gi + sizeof(*gi); strcpy(gi->group, group); |