mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
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
This commit is contained in:
@@ -141,14 +141,14 @@ static int function_txtcidname(struct ast_channel *chan, char *cmd,
|
|||||||
|
|
||||||
buf[0] = '\0';
|
buf[0] = '\0';
|
||||||
|
|
||||||
LOCAL_USER_ADD(u);
|
|
||||||
|
|
||||||
if (ast_strlen_zero(data)) {
|
if (ast_strlen_zero(data)) {
|
||||||
ast_log(LOG_WARNING, "TXTCIDNAME requires an argument (number)\n");
|
ast_log(LOG_WARNING, "TXTCIDNAME requires an argument (number)\n");
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
res = ast_get_txt(chan, data, dest, sizeof(dest), tech, sizeof(tech), txt,
|
res = ast_get_txt(chan, data, dest, sizeof(dest), tech, sizeof(tech), txt,
|
||||||
sizeof(txt));
|
sizeof(txt));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user