mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-25 07:01:09 +00:00
remove lots of useless checks of the result of ast_strdupa
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8379 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -129,11 +129,6 @@ static int auth_exec(struct ast_channel *chan, void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
argcopy = ast_strdupa(data);
|
argcopy = ast_strdupa(data);
|
||||||
if (!argcopy) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory!\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
AST_STANDARD_APP_ARGS(arglist,argcopy);
|
AST_STANDARD_APP_ARGS(arglist,argcopy);
|
||||||
|
|
||||||
|
@@ -383,10 +383,7 @@ static int chanspy_exec(struct ast_channel *chan, void *data)
|
|||||||
struct ast_flags flags;
|
struct ast_flags flags;
|
||||||
signed char zero_volume = 0;
|
signed char zero_volume = 0;
|
||||||
|
|
||||||
if (!(args = ast_strdupa((char *)data))) {
|
args = ast_strdupa(data);
|
||||||
ast_log(LOG_ERROR, "Out of memory!\n");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
|
@@ -129,11 +129,6 @@ static char *acf_curl_exec(struct ast_channel *chan, char *cmd, char *data, char
|
|||||||
LOCAL_USER_ACF_ADD(u);
|
LOCAL_USER_ACF_ADD(u);
|
||||||
|
|
||||||
info = ast_strdupa(data);
|
info = ast_strdupa(data);
|
||||||
if (!info) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return buf;
|
|
||||||
}
|
|
||||||
|
|
||||||
AST_STANDARD_APP_ARGS(args, info);
|
AST_STANDARD_APP_ARGS(args, info);
|
||||||
|
|
||||||
|
@@ -76,11 +76,6 @@ static int deltree_exec(struct ast_channel *chan, void *data)
|
|||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
argv = ast_strdupa(data);
|
argv = ast_strdupa(data);
|
||||||
if (!argv) {
|
|
||||||
ast_log(LOG_ERROR, "Memory allocation failed\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (strchr(argv, '/')) {
|
if (strchr(argv, '/')) {
|
||||||
family = strsep(&argv, "/");
|
family = strsep(&argv, "/");
|
||||||
@@ -122,11 +117,6 @@ static int del_exec(struct ast_channel *chan, void *data)
|
|||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
argv = ast_strdupa(data);
|
argv = ast_strdupa(data);
|
||||||
if (!argv) {
|
|
||||||
ast_log (LOG_ERROR, "Memory allocation failed\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (strchr(argv, '/')) {
|
if (strchr(argv, '/')) {
|
||||||
family = strsep(&argv, "/");
|
family = strsep(&argv, "/");
|
||||||
|
@@ -786,11 +786,7 @@ static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags
|
|||||||
|
|
||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
if (!(parse = ast_strdupa(data))) {
|
parse = ast_strdupa(data);
|
||||||
ast_log(LOG_WARNING, "Memory allocation failure\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
AST_STANDARD_APP_ARGS(args, parse);
|
AST_STANDARD_APP_ARGS(args, parse);
|
||||||
|
|
||||||
@@ -1628,11 +1624,6 @@ static int retrydial_exec(struct ast_channel *chan, void *data)
|
|||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
announce = ast_strdupa(data);
|
announce = ast_strdupa(data);
|
||||||
if (!announce) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory!\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
memset(&peerflags, 0, sizeof(peerflags));
|
memset(&peerflags, 0, sizeof(peerflags));
|
||||||
|
|
||||||
|
@@ -111,10 +111,6 @@ static int dictate_exec(struct ast_channel *chan, void *data)
|
|||||||
snprintf(dftbase, sizeof(dftbase), "%s/dictate", ast_config_AST_SPOOL_DIR);
|
snprintf(dftbase, sizeof(dftbase), "%s/dictate", ast_config_AST_SPOOL_DIR);
|
||||||
if (!ast_strlen_zero(data)) {
|
if (!ast_strlen_zero(data)) {
|
||||||
parse = ast_strdupa(data);
|
parse = ast_strdupa(data);
|
||||||
if (!parse) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory!\n");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
AST_STANDARD_APP_ARGS(args, parse);
|
AST_STANDARD_APP_ARGS(args, parse);
|
||||||
} else
|
} else
|
||||||
args.argc = 0;
|
args.argc = 0;
|
||||||
|
@@ -433,12 +433,6 @@ static int directory_exec(struct ast_channel *chan, void *data)
|
|||||||
|
|
||||||
parse = ast_strdupa(data);
|
parse = ast_strdupa(data);
|
||||||
|
|
||||||
if (!parse) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory!\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
AST_STANDARD_APP_ARGS(args, parse);
|
AST_STANDARD_APP_ARGS(args, parse);
|
||||||
|
|
||||||
if (args.options) {
|
if (args.options) {
|
||||||
|
@@ -162,11 +162,6 @@ static int disa_exec(struct ast_channel *chan, void *data)
|
|||||||
ast_log(LOG_DEBUG, "Responsetimeout: %d\n", firstdigittimeout);
|
ast_log(LOG_DEBUG, "Responsetimeout: %d\n", firstdigittimeout);
|
||||||
|
|
||||||
tmp = ast_strdupa(data);
|
tmp = ast_strdupa(data);
|
||||||
if (!tmp) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
AST_STANDARD_APP_ARGS(args, tmp);
|
AST_STANDARD_APP_ARGS(args, tmp);
|
||||||
|
|
||||||
|
@@ -73,8 +73,7 @@ static int exec_exec(struct ast_channel *chan, void *data)
|
|||||||
|
|
||||||
/* Check and parse arguments */
|
/* Check and parse arguments */
|
||||||
if (data) {
|
if (data) {
|
||||||
s = ast_strdupa((char *)data);
|
s = ast_strdupa(data);
|
||||||
if (s) {
|
|
||||||
appname = strsep(&s, "(");
|
appname = strsep(&s, "(");
|
||||||
if (s) {
|
if (s) {
|
||||||
endargs = strrchr(s, ')');
|
endargs = strrchr(s, ')');
|
||||||
@@ -91,10 +90,6 @@ static int exec_exec(struct ast_channel *chan, void *data)
|
|||||||
res = -1;
|
res = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory\n");
|
|
||||||
res = -1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCAL_USER_REMOVE(u);
|
LOCAL_USER_REMOVE(u);
|
||||||
|
@@ -272,11 +272,6 @@ static int app_exec(struct ast_channel *chan, void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
buf = ast_strdupa(data);
|
buf = ast_strdupa(data);
|
||||||
if (!buf) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory!\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
argc = ast_app_separate_args(buf, '|', argv, sizeof(argv) / sizeof(argv[0]));
|
argc = ast_app_separate_args(buf, '|', argv, sizeof(argv) / sizeof(argv[0]));
|
||||||
|
|
||||||
|
@@ -340,12 +340,6 @@ static int festival_exec(struct ast_channel *chan, void *vdata)
|
|||||||
}
|
}
|
||||||
|
|
||||||
data = ast_strdupa(vdata);
|
data = ast_strdupa(vdata);
|
||||||
if (!data) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memery\n");
|
|
||||||
ast_config_destroy(cfg);
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
intstr = strchr(data, '|');
|
intstr = strchr(data, '|');
|
||||||
if (intstr) {
|
if (intstr) {
|
||||||
|
@@ -130,11 +130,6 @@ static int hasvoicemail_exec(struct ast_channel *chan, void *data)
|
|||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
input = ast_strdupa((char *)data);
|
input = ast_strdupa((char *)data);
|
||||||
if (! input) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory error\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
AST_STANDARD_APP_ARGS(args, input);
|
AST_STANDARD_APP_ARGS(args, input);
|
||||||
|
|
||||||
@@ -194,11 +189,6 @@ static char *acf_vmcount_exec(struct ast_channel *chan, char *cmd, char *data, c
|
|||||||
buf[0] = '\0';
|
buf[0] = '\0';
|
||||||
|
|
||||||
argsstr = ast_strdupa(data);
|
argsstr = ast_strdupa(data);
|
||||||
if (!argsstr) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return buf;
|
|
||||||
}
|
|
||||||
|
|
||||||
AST_STANDARD_APP_ARGS(args, argsstr);
|
AST_STANDARD_APP_ARGS(args, argsstr);
|
||||||
|
|
||||||
|
@@ -78,11 +78,7 @@ static int sendimage_exec(struct ast_channel *chan, void *data)
|
|||||||
|
|
||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
if (!(parse = ast_strdupa(data))) {
|
parse = ast_strdupa(data);
|
||||||
ast_log(LOG_WARNING, "Memory Error!\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
AST_STANDARD_APP_ARGS(args, parse);
|
AST_STANDARD_APP_ARGS(args, parse);
|
||||||
|
|
||||||
|
@@ -308,11 +308,6 @@ static int macroif_exec(struct ast_channel *chan, void *data)
|
|||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
expr = ast_strdupa(data);
|
expr = ast_strdupa(data);
|
||||||
if (!expr) {
|
|
||||||
ast_log(LOG_ERROR, "Out of Memory!\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((label_a = strchr(expr, '?'))) {
|
if ((label_a = strchr(expr, '?'))) {
|
||||||
*label_a = '\0';
|
*label_a = '\0';
|
||||||
|
@@ -1779,10 +1779,6 @@ static struct ast_conference *find_conf(struct ast_channel *chan, char *confno,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
parse = ast_strdupa(var->value);
|
parse = ast_strdupa(var->value);
|
||||||
if (!parse) {
|
|
||||||
ast_log(LOG_ERROR, "Out of Memory!\n");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
AST_STANDARD_APP_ARGS(args, parse);
|
AST_STANDARD_APP_ARGS(args, parse);
|
||||||
if (!strcasecmp(args.confno, confno)) {
|
if (!strcasecmp(args.confno, confno)) {
|
||||||
@@ -1839,11 +1835,6 @@ static int count_exec(struct ast_channel *chan, void *data)
|
|||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
localdata = ast_strdupa(data);
|
localdata = ast_strdupa(data);
|
||||||
if (!localdata) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory!\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
AST_STANDARD_APP_ARGS(args, localdata);
|
AST_STANDARD_APP_ARGS(args, localdata);
|
||||||
|
|
||||||
|
@@ -333,11 +333,7 @@ static int mixmonitor_exec(struct ast_channel *chan, void *data)
|
|||||||
|
|
||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
if (!(parse = ast_strdupa(data))) {
|
parse = ast_strdupa(data);
|
||||||
ast_log(LOG_WARNING, "Memory Error!\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
AST_STANDARD_APP_ARGS(args, parse);
|
AST_STANDARD_APP_ARGS(args, parse);
|
||||||
|
|
||||||
|
@@ -139,11 +139,6 @@ static int osplookup_exec(struct ast_channel *chan, void *data)
|
|||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
temp = ast_strdupa(data);
|
temp = ast_strdupa(data);
|
||||||
if (!temp) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory!\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
AST_STANDARD_APP_ARGS(args, temp);
|
AST_STANDARD_APP_ARGS(args, temp);
|
||||||
|
|
||||||
@@ -202,11 +197,6 @@ static int ospnext_exec(struct ast_channel *chan, void *data)
|
|||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
temp = ast_strdupa(data);
|
temp = ast_strdupa(data);
|
||||||
if (!temp) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory!\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
AST_STANDARD_APP_ARGS(args, temp);
|
AST_STANDARD_APP_ARGS(args, temp);
|
||||||
|
|
||||||
@@ -276,11 +266,6 @@ static int ospfinished_exec(struct ast_channel *chan, void *data)
|
|||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
temp = ast_strdupa(data);
|
temp = ast_strdupa(data);
|
||||||
if (!temp) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory!\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
AST_STANDARD_APP_ARGS(args, temp);
|
AST_STANDARD_APP_ARGS(args, temp);
|
||||||
|
|
||||||
|
@@ -164,11 +164,6 @@ static int page_exec(struct ast_channel *chan, void *data)
|
|||||||
};
|
};
|
||||||
|
|
||||||
options = ast_strdupa(data);
|
options = ast_strdupa(data);
|
||||||
if (!options) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
tmp = strsep(&options, "|");
|
tmp = strsep(&options, "|");
|
||||||
if (options)
|
if (options)
|
||||||
|
@@ -90,10 +90,6 @@ static int playback_exec(struct ast_channel *chan, void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
tmp = ast_strdupa(data);
|
tmp = ast_strdupa(data);
|
||||||
if (!tmp) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory!\n");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
AST_STANDARD_APP_ARGS(args, tmp);
|
AST_STANDARD_APP_ARGS(args, tmp);
|
||||||
|
@@ -118,11 +118,6 @@ static int privacy_exec (struct ast_channel *chan, void *data)
|
|||||||
if (!ast_strlen_zero((char *)data))
|
if (!ast_strlen_zero((char *)data))
|
||||||
{
|
{
|
||||||
parse = ast_strdupa(data);
|
parse = ast_strdupa(data);
|
||||||
if (!parse) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory!\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
AST_STANDARD_APP_ARGS(args, parse);
|
AST_STANDARD_APP_ARGS(args, parse);
|
||||||
|
|
||||||
|
@@ -2645,11 +2645,7 @@ static int pqm_exec(struct ast_channel *chan, void *data)
|
|||||||
|
|
||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
if (!(parse = ast_strdupa(data))) {
|
parse = ast_strdupa(data);
|
||||||
ast_log(LOG_WARNING, "Memory Error!\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
AST_STANDARD_APP_ARGS(args, parse);
|
AST_STANDARD_APP_ARGS(args, parse);
|
||||||
|
|
||||||
@@ -2701,11 +2697,7 @@ static int upqm_exec(struct ast_channel *chan, void *data)
|
|||||||
|
|
||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
if (!(parse = ast_strdupa(data))) {
|
parse = ast_strdupa(data);
|
||||||
ast_log(LOG_WARNING, "Memory Error!\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
AST_STANDARD_APP_ARGS(args, parse);
|
AST_STANDARD_APP_ARGS(args, parse);
|
||||||
|
|
||||||
@@ -2759,11 +2751,7 @@ static int rqm_exec(struct ast_channel *chan, void *data)
|
|||||||
|
|
||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
if (!(parse = ast_strdupa(data))) {
|
parse = ast_strdupa(data);
|
||||||
ast_log(LOG_WARNING, "Memory Error!\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
AST_STANDARD_APP_ARGS(args, parse);
|
AST_STANDARD_APP_ARGS(args, parse);
|
||||||
|
|
||||||
|
@@ -74,11 +74,6 @@ static int random_exec(struct ast_channel *chan, void *data)
|
|||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
s = ast_strdupa(data);
|
s = ast_strdupa(data);
|
||||||
if (!s) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory!\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
prob = strsep(&s,":");
|
prob = strsep(&s,":");
|
||||||
if ((!prob) || (sscanf(prob, "%d", &probint) != 1))
|
if ((!prob) || (sscanf(prob, "%d", &probint) != 1))
|
||||||
|
@@ -118,11 +118,6 @@ static int read_exec(struct ast_channel *chan, void *data)
|
|||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
argcopy = ast_strdupa(data);
|
argcopy = ast_strdupa(data);
|
||||||
if (!argcopy) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory!\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
AST_STANDARD_APP_ARGS(arglist, argcopy);
|
AST_STANDARD_APP_ARGS(arglist, argcopy);
|
||||||
|
|
||||||
|
@@ -74,11 +74,6 @@ static int readfile_exec(struct ast_channel *chan, void *data)
|
|||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
s = ast_strdupa(data);
|
s = ast_strdupa(data);
|
||||||
if (!s) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
varname = strsep(&s, "=");
|
varname = strsep(&s, "=");
|
||||||
file = strsep(&s, "|");
|
file = strsep(&s, "|");
|
||||||
|
@@ -148,7 +148,7 @@ static int realtime_update_exec(struct ast_channel *chan, void *data)
|
|||||||
|
|
||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
if ((family = ast_strdupa(data))) {
|
family = ast_strdupa(data);
|
||||||
if ((colmatch = strchr(family,'|'))) {
|
if ((colmatch = strchr(family,'|'))) {
|
||||||
crop_data(colmatch);
|
crop_data(colmatch);
|
||||||
if ((value = strchr(colmatch,'|'))) {
|
if ((value = strchr(colmatch,'|'))) {
|
||||||
@@ -160,8 +160,7 @@ static int realtime_update_exec(struct ast_channel *chan, void *data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if (!newval) {
|
||||||
if (! (family && value && colmatch && newcol && newval) ) {
|
|
||||||
ast_log(LOG_ERROR,"Invalid input: usage %s\n",UUSAGE);
|
ast_log(LOG_ERROR,"Invalid input: usage %s\n",UUSAGE);
|
||||||
res = -1;
|
res = -1;
|
||||||
} else {
|
} else {
|
||||||
@@ -193,7 +192,7 @@ static int realtime_exec(struct ast_channel *chan, void *data)
|
|||||||
|
|
||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
if ((family = ast_strdupa(data))) {
|
family = ast_strdupa(data);
|
||||||
if ((colmatch = strchr(family,'|'))) {
|
if ((colmatch = strchr(family,'|'))) {
|
||||||
crop_data(colmatch);
|
crop_data(colmatch);
|
||||||
if ((value = strchr(colmatch,'|'))) {
|
if ((value = strchr(colmatch,'|'))) {
|
||||||
@@ -202,8 +201,7 @@ static int realtime_exec(struct ast_channel *chan, void *data)
|
|||||||
crop_data(prefix);
|
crop_data(prefix);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if (!value) {
|
||||||
if (! (family && value && colmatch) ) {
|
|
||||||
ast_log(LOG_ERROR,"Invalid input: usage %s\n",USAGE);
|
ast_log(LOG_ERROR,"Invalid input: usage %s\n",USAGE);
|
||||||
res = -1;
|
res = -1;
|
||||||
} else {
|
} else {
|
||||||
|
@@ -117,11 +117,6 @@ static int record_exec(struct ast_channel *chan, void *data)
|
|||||||
|
|
||||||
/* Yay for strsep being easy */
|
/* Yay for strsep being easy */
|
||||||
vdata = ast_strdupa(data);
|
vdata = ast_strdupa(data);
|
||||||
if (!vdata) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
p = vdata;
|
p = vdata;
|
||||||
filename = strsep(&p, "|");
|
filename = strsep(&p, "|");
|
||||||
|
@@ -92,9 +92,7 @@ static int sayunixtime_exec(struct ast_channel *chan, void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
s = data;
|
s = ast_strdupa(data);
|
||||||
s = ast_strdupa(s);
|
|
||||||
if (s) {
|
|
||||||
timec = strsep(&s,"|");
|
timec = strsep(&s,"|");
|
||||||
if ((timec) && (*timec != '\0')) {
|
if ((timec) && (*timec != '\0')) {
|
||||||
long timein;
|
long timein;
|
||||||
@@ -110,9 +108,6 @@ static int sayunixtime_exec(struct ast_channel *chan, void *data)
|
|||||||
format = s;
|
format = s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory error\n");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chan->_state != AST_STATE_UP) {
|
if (chan->_state != AST_STATE_UP) {
|
||||||
|
@@ -75,11 +75,6 @@ static int senddtmf_exec(struct ast_channel *chan, void *data)
|
|||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
digits = ast_strdupa(data);
|
digits = ast_strdupa(data);
|
||||||
if (!digits) {
|
|
||||||
ast_log(LOG_ERROR, "Out of Memory!\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((to = strchr(digits,'|'))) {
|
if ((to = strchr(digits,'|'))) {
|
||||||
*to = '\0';
|
*to = '\0';
|
||||||
|
@@ -87,14 +87,8 @@ static int sendtext_exec(struct ast_channel *chan, void *data)
|
|||||||
ast_log(LOG_WARNING, "SendText requires an argument (text[|options])\n");
|
ast_log(LOG_WARNING, "SendText requires an argument (text[|options])\n");
|
||||||
LOCAL_USER_REMOVE(u);
|
LOCAL_USER_REMOVE(u);
|
||||||
return -1;
|
return -1;
|
||||||
} else {
|
} else
|
||||||
parse = ast_strdupa(data);
|
parse = ast_strdupa(data);
|
||||||
if (!parse) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory!\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AST_STANDARD_APP_ARGS(args, parse);
|
AST_STANDARD_APP_ARGS(args, parse);
|
||||||
|
|
||||||
|
@@ -118,11 +118,6 @@ static int setcallerid_exec(struct ast_channel *chan, void *data)
|
|||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
tmp = ast_strdupa(data);
|
tmp = ast_strdupa(data);
|
||||||
if (!tmp) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
opt = strchr(tmp, '|');
|
opt = strchr(tmp, '|');
|
||||||
if (opt) {
|
if (opt) {
|
||||||
|
@@ -88,11 +88,6 @@ static int app_exec(struct ast_channel *chan, void *data)
|
|||||||
|
|
||||||
/* We need to make a copy of the input string if we are going to modify it! */
|
/* We need to make a copy of the input string if we are going to modify it! */
|
||||||
args = ast_strdupa(data);
|
args = ast_strdupa(data);
|
||||||
if (!args) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory!\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((argc = ast_app_separate_args(args, '|', argv, sizeof(argv) / sizeof(argv[0])))) {
|
if ((argc = ast_app_separate_args(args, '|', argv, sizeof(argv) / sizeof(argv[0])))) {
|
||||||
dummy = argv[0];
|
dummy = argv[0];
|
||||||
|
@@ -130,10 +130,6 @@ static int gosubif_exec(struct ast_channel *chan, void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
args = ast_strdupa((char *)data);
|
args = ast_strdupa((char *)data);
|
||||||
if (!args) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory\n");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
|
@@ -89,11 +89,6 @@ static int background_detect_exec(struct ast_channel *chan, void *data)
|
|||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
tmp = ast_strdupa(data);
|
tmp = ast_strdupa(data);
|
||||||
if (!tmp) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
stringp=tmp;
|
stringp=tmp;
|
||||||
strsep(&stringp, "|");
|
strsep(&stringp, "|");
|
||||||
|
@@ -88,19 +88,14 @@ static int transfer_exec(struct ast_channel *chan, void *data)
|
|||||||
|
|
||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
if (ast_strlen_zero((char *)data)) {
|
if (ast_strlen_zero(data)) {
|
||||||
ast_log(LOG_WARNING, "Transfer requires an argument ([Tech/]destination[|options])\n");
|
ast_log(LOG_WARNING, "Transfer requires an argument ([Tech/]destination[|options])\n");
|
||||||
LOCAL_USER_REMOVE(u);
|
LOCAL_USER_REMOVE(u);
|
||||||
pbx_builtin_setvar_helper(chan, "TRANSFERSTATUS", "FAILURE");
|
pbx_builtin_setvar_helper(chan, "TRANSFERSTATUS", "FAILURE");
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
}
|
||||||
|
|
||||||
parse = ast_strdupa(data);
|
parse = ast_strdupa(data);
|
||||||
if (!parse) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory!\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AST_STANDARD_APP_ARGS(args, parse);
|
AST_STANDARD_APP_ARGS(args, parse);
|
||||||
|
|
||||||
|
@@ -94,14 +94,8 @@ static int sendurl_exec(struct ast_channel *chan, void *data)
|
|||||||
|
|
||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
tmp = ast_strdupa(data);
|
stringp = tmp = ast_strdupa(data);
|
||||||
if (!tmp) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
stringp=tmp;
|
|
||||||
strsep(&stringp, "|");
|
strsep(&stringp, "|");
|
||||||
options = strsep(&stringp, "|");
|
options = strsep(&stringp, "|");
|
||||||
if (options && !strcasecmp(options, "wait"))
|
if (options && !strcasecmp(options, "wait"))
|
||||||
|
@@ -75,11 +75,6 @@ static int userevent_exec(struct ast_channel *chan, void *data)
|
|||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
info = ast_strdupa(data);
|
info = ast_strdupa(data);
|
||||||
if (!info) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
snprintf(eventname, sizeof(eventname), "UserEvent%s", info);
|
snprintf(eventname, sizeof(eventname), "UserEvent%s", info);
|
||||||
eventbody = strchr(eventname, '|');
|
eventbody = strchr(eventname, '|');
|
||||||
|
@@ -67,8 +67,7 @@ static int verbose_exec(struct ast_channel *chan, void *data)
|
|||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
vtext = ast_strdupa((char *)data);
|
vtext = ast_strdupa(data);
|
||||||
if (vtext) {
|
|
||||||
char *tmp = strsep(&vtext, "|,");
|
char *tmp = strsep(&vtext, "|,");
|
||||||
if (vtext) {
|
if (vtext) {
|
||||||
if (sscanf(tmp, "%d", &vsize) != 1) {
|
if (sscanf(tmp, "%d", &vsize) != 1) {
|
||||||
@@ -97,9 +96,6 @@ static int verbose_exec(struct ast_channel *chan, void *data)
|
|||||||
ast_verbose(VERBOSE_PREFIX_4 "%s\n", vtext);
|
ast_verbose(VERBOSE_PREFIX_4 "%s\n", vtext);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory\n");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LOCAL_USER_REMOVE(u);
|
LOCAL_USER_REMOVE(u);
|
||||||
@@ -121,11 +117,6 @@ static int log_exec(struct ast_channel *chan, void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ltext = ast_strdupa(data);
|
ltext = ast_strdupa(data);
|
||||||
if (!ltext) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
level = strsep(<ext, "|");
|
level = strsep(<ext, "|");
|
||||||
|
|
||||||
|
@@ -3284,9 +3284,7 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
|
|||||||
snprintf(ext_context, sizeof(ext_context), "%s@%s", vmu->mailbox, vmu->context);
|
snprintf(ext_context, sizeof(ext_context), "%s@%s", vmu->mailbox, vmu->context);
|
||||||
|
|
||||||
/* Attach only the first format */
|
/* Attach only the first format */
|
||||||
fmt = ast_strdupa(fmt);
|
stringp = fmt = ast_strdupa(fmt);
|
||||||
if (fmt) {
|
|
||||||
stringp = fmt;
|
|
||||||
strsep(&stringp, "|");
|
strsep(&stringp, "|");
|
||||||
|
|
||||||
if (!ast_strlen_zero(vmu->email)) {
|
if (!ast_strlen_zero(vmu->email)) {
|
||||||
@@ -3304,9 +3302,6 @@ static int notify_new_message(struct ast_channel *chan, struct ast_vm_user *vmu,
|
|||||||
myserveremail = vmu->serveremail;
|
myserveremail = vmu->serveremail;
|
||||||
sendpage(myserveremail, vmu->pager, msgnum, vmu->context, vmu->mailbox, cidnum, cidname, duration, vmu, category);
|
sendpage(myserveremail, vmu->pager, msgnum, vmu->context, vmu->mailbox, cidnum, cidname, duration, vmu, category);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ast_test_flag(vmu, VM_DELETE)) {
|
if (ast_test_flag(vmu, VM_DELETE)) {
|
||||||
DELETE(todir, msgnum, fn);
|
DELETE(todir, msgnum, fn);
|
||||||
@@ -5058,11 +5053,6 @@ static int vm_execmain(struct ast_channel *chan, void *data)
|
|||||||
);
|
);
|
||||||
|
|
||||||
parse = ast_strdupa(data);
|
parse = ast_strdupa(data);
|
||||||
if (!parse) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory!\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
AST_STANDARD_APP_ARGS(args, parse);
|
AST_STANDARD_APP_ARGS(args, parse);
|
||||||
|
|
||||||
@@ -5648,11 +5638,6 @@ static int vm_box_exists(struct ast_channel *chan, void *data)
|
|||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
box = ast_strdupa(data);
|
box = ast_strdupa(data);
|
||||||
if (!box) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
AST_STANDARD_APP_ARGS(args, box);
|
AST_STANDARD_APP_ARGS(args, box);
|
||||||
|
|
||||||
@@ -5690,10 +5675,6 @@ static int vmauthenticate(struct ast_channel *chan, void *data)
|
|||||||
|
|
||||||
if (s) {
|
if (s) {
|
||||||
s = ast_strdupa(s);
|
s = ast_strdupa(s);
|
||||||
if (!s) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory\n");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
user = strsep(&s, "|");
|
user = strsep(&s, "|");
|
||||||
options = strsep(&s, "|");
|
options = strsep(&s, "|");
|
||||||
if (user) {
|
if (user) {
|
||||||
@@ -6140,7 +6121,6 @@ static int load_config(void)
|
|||||||
if ((z = ast_malloc(sizeof(*z)))) {
|
if ((z = ast_malloc(sizeof(*z)))) {
|
||||||
char *msg_format, *timezone;
|
char *msg_format, *timezone;
|
||||||
msg_format = ast_strdupa(var->value);
|
msg_format = ast_strdupa(var->value);
|
||||||
if (msg_format != NULL) {
|
|
||||||
timezone = strsep(&msg_format, "|");
|
timezone = strsep(&msg_format, "|");
|
||||||
if (msg_format) {
|
if (msg_format) {
|
||||||
ast_copy_string(z->name, var->name, sizeof(z->name));
|
ast_copy_string(z->name, var->name, sizeof(z->name));
|
||||||
@@ -6158,11 +6138,6 @@ static int load_config(void)
|
|||||||
ast_log(LOG_WARNING, "Invalid timezone definition at line %d\n", var->lineno);
|
ast_log(LOG_WARNING, "Invalid timezone definition at line %d\n", var->lineno);
|
||||||
free(z);
|
free(z);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
ast_log(LOG_WARNING, "Out of memory while reading voicemail config\n");
|
|
||||||
free(z);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@@ -90,11 +90,6 @@ static int execif_exec(struct ast_channel *chan, void *data) {
|
|||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
expr = ast_strdupa(data);
|
expr = ast_strdupa(data);
|
||||||
if (!expr) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((myapp = strchr(expr,'|'))) {
|
if ((myapp = strchr(expr,'|'))) {
|
||||||
*myapp = '\0';
|
*myapp = '\0';
|
||||||
@@ -244,9 +239,8 @@ static int _while_exec(struct ast_channel *chan, void *data, int end)
|
|||||||
snprintf(used_index, VAR_SIZE, "%d", used_index_i);
|
snprintf(used_index, VAR_SIZE, "%d", used_index_i);
|
||||||
snprintf(new_index, VAR_SIZE, "%d", used_index_i + 1);
|
snprintf(new_index, VAR_SIZE, "%d", used_index_i + 1);
|
||||||
|
|
||||||
if (!end) {
|
if (!end)
|
||||||
condition = ast_strdupa((char *) data);
|
condition = ast_strdupa(data);
|
||||||
}
|
|
||||||
|
|
||||||
size = strlen(chan->context) + strlen(chan->exten) + 32;
|
size = strlen(chan->context) + strlen(chan->exten) + 32;
|
||||||
my_name = alloca(size);
|
my_name = alloca(size);
|
||||||
|
@@ -210,11 +210,6 @@ static int zapras_exec(struct ast_channel *chan, void *data)
|
|||||||
LOCAL_USER_ADD(u);
|
LOCAL_USER_ADD(u);
|
||||||
|
|
||||||
args = ast_strdupa(data);
|
args = ast_strdupa(data);
|
||||||
if (!args) {
|
|
||||||
ast_log(LOG_ERROR, "Out of memory\n");
|
|
||||||
LOCAL_USER_REMOVE(u);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Answer the channel if it's not up */
|
/* Answer the channel if it's not up */
|
||||||
if (chan->_state != AST_STATE_UP)
|
if (chan->_state != AST_STATE_UP)
|
||||||
|
Reference in New Issue
Block a user