Don't unref user twice on failure. Also, when adding sorted list of users, it is...
authorTerry Wilson <twilson@digium.com>
Mon, 14 Apr 2008 19:12:27 +0000 (19:12 +0000)
committerTerry Wilson <twilson@digium.com>
Mon, 14 Apr 2008 19:12:27 +0000 (19:12 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114124 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_phoneprov.c

index 5d9ec27..2468e36 100644 (file)
@@ -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);
                        }
                }