[asterisk-commits] trunk r14785 - /trunk/funcs/func_enum.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Mar 24 11:33:50 MST 2006


Author: rizzo
Date: Fri Mar 24 12:33:48 2006
New Revision: 14785

URL: http://svn.digium.com/view/asterisk?rev=14785&view=rev
Log:
Do the (expensive) LOCAL_USER_ADD only after we are sure
that arguments are valid.


Modified:
    trunk/funcs/func_enum.c

Modified: trunk/funcs/func_enum.c
URL: http://svn.digium.com/view/asterisk/trunk/funcs/func_enum.c?rev=14785&r1=14784&r2=14785&view=diff
==============================================================================
--- trunk/funcs/func_enum.c (original)
+++ trunk/funcs/func_enum.c Fri Mar 24 12:33:48 2006
@@ -141,13 +141,13 @@
 
 	buf[0] = '\0';
 
-	LOCAL_USER_ADD(u);
 
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "TXTCIDNAME requires an argument (number)\n");
-		LOCAL_USER_REMOVE(u);
 		return -1;
 	}
+
+	LOCAL_USER_ADD(u);
 
 	res = ast_get_txt(chan, data, dest, sizeof(dest), tech, sizeof(tech), txt,
 			  sizeof(txt));



More information about the asterisk-commits mailing list