diff options
author | twilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-04-14 19:12:27 +0000 |
---|---|---|
committer | twilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-04-14 19:12:27 +0000 |
commit | 27d1870f0d45b3fd093bf16b89aec789a820ec37 (patch) | |
tree | 1f1dc7444cb6a6643a196785da4a419fa3d7da26 /res | |
parent | a77799ade3ae7f28a1c6385295941e83e219e352 (diff) |
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: http://svn.digium.com/svn/asterisk/trunk@114124 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r-- | res/res_phoneprov.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/res/res_phoneprov.c b/res/res_phoneprov.c index 5d9ec27e3..2468e36df 100644 --- a/res/res_phoneprov.c +++ b/res/res_phoneprov.c @@ -866,9 +866,8 @@ static int add_user_extension(struct user *user, struct extension *exten) AST_LIST_INSERT_BEFORE_CURRENT(exten, entry); } else if (exten->index == exten_iter->index) { 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; - } else if (!AST_LIST_NEXT(exten, entry)) { + } else if (!AST_LIST_NEXT(exten_iter, entry)) { AST_LIST_INSERT_TAIL(&user->extensions, exten, entry); } } |