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

ast_strdup can handle NULL args well, so use it.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21817 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 7d9c26df
No related branches found
No related tags found
No related merge requests found
...@@ -327,25 +327,10 @@ static int features_call(struct ast_channel *ast, char *dest, int timeout) ...@@ -327,25 +327,10 @@ static int features_call(struct ast_channel *ast, char *dest, int timeout)
ast_mutex_lock(&p->lock); ast_mutex_lock(&p->lock);
x = indexof(p, ast, 0); x = indexof(p, ast, 0);
if (!x && p->subchan) { if (!x && p->subchan) {
if (p->owner->cid.cid_num) p->subchan->cid.cid_num = ast_strdup(p->owner->cid.cid_num);
p->subchan->cid.cid_num = strdup(p->owner->cid.cid_num); p->subchan->cid.cid_name = ast_strdup(p->owner->cid.cid_name);
else p->subchan->cid.cid_rdnis = ast_strdup(p->owner->cid.cid_rdnis);
p->subchan->cid.cid_num = NULL; p->subchan->cid.cid_ani = ast_strdup(p->owner->cid.cid_ani);
if (p->owner->cid.cid_name)
p->subchan->cid.cid_name = strdup(p->owner->cid.cid_name);
else
p->subchan->cid.cid_name = NULL;
if (p->owner->cid.cid_rdnis)
p->subchan->cid.cid_rdnis = strdup(p->owner->cid.cid_rdnis);
else
p->subchan->cid.cid_rdnis = NULL;
if (p->owner->cid.cid_ani)
p->subchan->cid.cid_ani = strdup(p->owner->cid.cid_ani);
else
p->subchan->cid.cid_ani = NULL;
p->subchan->cid.cid_pres = p->owner->cid.cid_pres; p->subchan->cid.cid_pres = p->owner->cid.cid_pres;
ast_string_field_set(p->subchan, language, p->owner->language); ast_string_field_set(p->subchan, language, p->owner->language);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment