summaryrefslogtreecommitdiff
path: root/channels/chan_local.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels/chan_local.c')
-rw-r--r--channels/chan_local.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c
index b2c7b9ed4..5e522e797 100644
--- a/channels/chan_local.c
+++ b/channels/chan_local.c
@@ -574,21 +574,15 @@ start_over:
* All these failure points just return -1. The individual strings will
* be cleared when we destroy the channel.
*/
- if (p->owner->cid.cid_rdnis) {
- if (!(p->chan->cid.cid_rdnis = ast_strdup(p->owner->cid.cid_rdnis))) {
- ast_mutex_unlock(&p->lock);
- ast_channel_unlock(p->chan);
- return -1;
- }
- }
ast_party_redirecting_copy(&p->chan->redirecting, &p->owner->redirecting);
- if (p->owner->cid.cid_dnid) {
- if (!(p->chan->cid.cid_dnid = ast_strdup(p->owner->cid.cid_dnid))) {
- ast_mutex_unlock(&p->lock);
- ast_channel_unlock(p->chan);
- return -1;
- }
+ ast_free(p->chan->cid.cid_dnid);
+ p->chan->cid.cid_dnid = ast_strdup(p->owner->cid.cid_dnid);
+ if (!p->chan->cid.cid_dnid && p->owner->cid.cid_dnid) {
+ /* Allocation failure */
+ ast_mutex_unlock(&p->lock);
+ ast_channel_unlock(p->chan);
+ return -1;
}
p->chan->cid.cid_tns = p->owner->cid.cid_tns;