diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-04-10 16:26:48 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-04-10 16:26:48 +0000 |
commit | 0fdeed176c63464206aefcaa5fac339ce3d36ddb (patch) | |
tree | 5108f44ee609ac3e3cda74e5eee9397a45a0e156 | |
parent | 37f2471e2ba66cf3932a8a80f605cc1ee1767db5 (diff) |
ast_strdup failures aren't really failures if the original value was NULL.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@187714 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channels/chan_local.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c index 509e69b10..89a77d838 100644 --- a/channels/chan_local.c +++ b/channels/chan_local.c @@ -566,13 +566,17 @@ start_over: * All these failure points just return -1. The individual strings will * be cleared when we destroy the channel. */ - if (!(p->chan->cid.cid_rdnis = ast_strdup(p->owner->cid.cid_rdnis))) { - return -1; + if (p->owner->cid.cid_rdnis) { + if (!(p->chan->cid.cid_rdnis = ast_strdup(p->owner->cid.cid_rdnis))) { + return -1; + } } ast_party_redirecting_copy(&p->chan->redirecting, &p->owner->redirecting); - if (!(p->chan->cid.cid_dnid = ast_strdup(p->owner->cid.cid_dnid))) { - return -1; + if (p->owner->cid.cid_dnid) { + if (!(p->chan->cid.cid_dnid = ast_strdup(p->owner->cid.cid_dnid))) { + return -1; + } } p->chan->cid.cid_tns = p->owner->cid.cid_tns; |