Consolidate ast_channel.cid.cid_rdnis into ast_channel.redirecting.from.number.

SWP-1229
ABE-2161

* Ensure chan_local.c:local_call() will not leak cid.cid_dnid when
copying.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256104 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Richard Mudgett
2010-04-03 02:12:33 +00:00
parent 5333a48b17
commit a5a0a5f867
20 changed files with 66 additions and 118 deletions

View File

@@ -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;