Skip to content
Snippets Groups Projects
Commit 82b04003 authored by Luigi Rizzo's avatar Luigi Rizzo
Browse files

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
parent b3ad3a75
No related branches found
No related tags found
No related merge requests found
......@@ -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));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment