aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/app_macro.c13
-rw-r--r--apps/app_queue.c3
2 files changed, 5 insertions, 11 deletions
diff --git a/apps/app_macro.c b/apps/app_macro.c
index 4b88e1594..63cf46474 100644
--- a/apps/app_macro.c
+++ b/apps/app_macro.c
@@ -89,11 +89,6 @@ STANDARD_LOCAL_USER;
LOCAL_USER_DECL;
-static char *safe_strdup(const char *s)
-{
- return s ? strdup(s) : NULL;
-}
-
static int macro_exec(struct ast_channel *chan, void *data)
{
const char *s;
@@ -169,17 +164,17 @@ static int macro_exec(struct ast_channel *chan, void *data)
}
argc = 1;
/* Save old macro variables */
- save_macro_exten = safe_strdup(pbx_builtin_getvar_helper(chan, "MACRO_EXTEN"));
+ save_macro_exten = ast_strdup(pbx_builtin_getvar_helper(chan, "MACRO_EXTEN"));
pbx_builtin_setvar_helper(chan, "MACRO_EXTEN", oldexten);
- save_macro_context = safe_strdup(pbx_builtin_getvar_helper(chan, "MACRO_CONTEXT"));
+ save_macro_context = ast_strdup(pbx_builtin_getvar_helper(chan, "MACRO_CONTEXT"));
pbx_builtin_setvar_helper(chan, "MACRO_CONTEXT", oldcontext);
- save_macro_priority = safe_strdup(pbx_builtin_getvar_helper(chan, "MACRO_PRIORITY"));
+ save_macro_priority = ast_strdup(pbx_builtin_getvar_helper(chan, "MACRO_PRIORITY"));
snprintf(pc, sizeof(pc), "%d", oldpriority);
pbx_builtin_setvar_helper(chan, "MACRO_PRIORITY", pc);
- save_macro_offset = safe_strdup(pbx_builtin_getvar_helper(chan, "MACRO_OFFSET"));
+ save_macro_offset = ast_strdup(pbx_builtin_getvar_helper(chan, "MACRO_OFFSET"));
pbx_builtin_setvar_helper(chan, "MACRO_OFFSET", NULL);
/* Setup environment for new run */
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 669e25d86..06aebe724 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -1709,8 +1709,7 @@ static struct localuser *wait_for_answer(struct queue_ent *qe, struct localuser
if (in->cid.cid_ani) {
if (o->chan->cid.cid_ani)
free(o->chan->cid.cid_ani);
- if ((o->chan->cid.cid_ani = ast_calloc(1, strlen(in->cid.cid_ani) + 1)))
- strncpy(o->chan->cid.cid_ani, in->cid.cid_ani, strlen(in->cid.cid_ani) + 1);
+ o->chan->cid.cid_ani = ast_strdup(in->cid.cid_ani);
}
if (o->chan->cid.cid_rdnis)
free(o->chan->cid.cid_rdnis);