From: Luigi Rizzo Date: Fri, 24 Mar 2006 18:33:48 +0000 (+0000) Subject: Do the (expensive) LOCAL_USER_ADD only after we are sure X-Git-Tag: 1.4.0-beta1~2335 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82b040032268e622610b4c4892af4c77722bc4a3;p=thirdparty%2Fasterisk.git Do the (expensive) LOCAL_USER_ADD only after we are sure that arguments are valid. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@14785 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/funcs/func_enum.c b/funcs/func_enum.c index 5f1b01d569..87f321edc3 100644 --- a/funcs/func_enum.c +++ b/funcs/func_enum.c @@ -141,14 +141,14 @@ static int function_txtcidname(struct ast_channel *chan, char *cmd, 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));