mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 20:04:50 +00:00
Don't unref user twice on failure. Also, when adding sorted list of users, it is best to check the entry already in the list for a "next" entry instead of the newly created entry...
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114124 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -866,9 +866,8 @@ static int add_user_extension(struct user *user, struct extension *exten)
|
|||||||
AST_LIST_INSERT_BEFORE_CURRENT(exten, entry);
|
AST_LIST_INSERT_BEFORE_CURRENT(exten, entry);
|
||||||
} else if (exten->index == exten_iter->index) {
|
} else if (exten->index == exten_iter->index) {
|
||||||
ast_log(LOG_WARNING, "Duplicate linenumber=%d for %s\n", exten->index, user->macaddress);
|
ast_log(LOG_WARNING, "Duplicate linenumber=%d for %s\n", exten->index, user->macaddress);
|
||||||
user = unref_user(user); /* Profile should be unreffed now that it is attached to the user */
|
|
||||||
return -1;
|
return -1;
|
||||||
} else if (!AST_LIST_NEXT(exten, entry)) {
|
} else if (!AST_LIST_NEXT(exten_iter, entry)) {
|
||||||
AST_LIST_INSERT_TAIL(&user->extensions, exten, entry);
|
AST_LIST_INSERT_TAIL(&user->extensions, exten, entry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user