[asterisk-commits] twilson: trunk r114124 - /trunk/res/res_phoneprov.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Apr 14 14:12:27 CDT 2008


Author: twilson
Date: Mon Apr 14 14:12:27 2008
New Revision: 114124

URL: http://svn.digium.com/view/asterisk?view=rev&rev=114124
Log:
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...

Modified:
    trunk/res/res_phoneprov.c

Modified: trunk/res/res_phoneprov.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_phoneprov.c?view=diff&rev=114124&r1=114123&r2=114124
==============================================================================
--- trunk/res/res_phoneprov.c (original)
+++ trunk/res/res_phoneprov.c Mon Apr 14 14:12:27 2008
@@ -866,9 +866,8 @@
 				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);
 			}
 		}




More information about the asterisk-commits mailing list