issue #5850
authorRussell Bryant <russell@russellbryant.com>
Fri, 25 Nov 2005 14:13:54 +0000 (14:13 +0000)
committerRussell Bryant <russell@russellbryant.com>
Fri, 25 Nov 2005 14:13:54 +0000 (14:13 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7195 65c4cc65-6c06-0410-ace0-fbb531ad65f3

ChangeLog
apps/app_dial.c

index e88a8ae..d88e458 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-11-25  Russell Bryant  <russell@digium.com>
+
+       * apps/app_dial.c: Properly duplicate the string for ANI (issue #5850)
+
 2005-11-23  Russell Bryant  <russell@digium.com>
 
        * configs/voicemail.conf.sample: Add note to indicate that #include should not be used for this file. (issue #5828)
index e1725b5..ff940dd 100755 (executable)
@@ -512,10 +512,8 @@ static struct ast_channel *wait_for_answer(struct ast_channel *in, struct localu
                                                if (in->cid.cid_ani) {
                                                        if (o->chan->cid.cid_ani)
                                                                free(o->chan->cid.cid_ani);
-                                                       o->chan->cid.cid_ani = malloc(strlen(in->cid.cid_ani) + 1);
-                                                       if (o->chan->cid.cid_ani)
-                                                               ast_copy_string(o->chan->cid.cid_ani, in->cid.cid_ani, sizeof(o->chan->cid.cid_ani));
-                                                       else
+                                                       o->chan->cid.cid_ani = strdup(in->cid.cid_ani);
+                                                       if (!o->chan->cid.cid_ani)
                                                                ast_log(LOG_WARNING, "Out of memory\n");
                                                }
                                                if (o->chan->cid.cid_rdnis)