# HG changeset patch # User Adam Chlipala # Date 1454626225 18000 # Node ID 8966edef462a41ceb8bccf9cd42d5d32ac228fc5 # Parent fe6049d23ce5a702adfd6e2c41fda580c5ce0277 Add more uw_strdup, which seems to avoid problems from reuse of memory diff -r fe6049d23ce5 -r 8966edef462a mail.c --- a/mail.c Thu Feb 04 13:01:33 2016 -0500 +++ b/mail.c Thu Feb 04 17:50:25 2016 -0500 @@ -61,7 +61,7 @@ ok: */ address(ctx, s); - h2->from = s; + h2->from = uw_strdup(ctx, s); return h2; } @@ -79,7 +79,9 @@ sprintf(all, "%s,%s", h2->to, s); h2->to = all; } else - h2->to = s; + h2->to = uw_strdup(ctx, s); + + fprintf(stderr, "TO: %s\n", h2->to); return h2; } @@ -97,7 +99,7 @@ sprintf(all, "%s,%s", h2->cc, s); h2->cc = all; } else - h2->cc = s; + h2->cc = uw_strdup(ctx, s); return h2; } @@ -115,7 +117,7 @@ sprintf(all, "%s,%s", h2->bcc, s); h2->bcc = all; } else - h2->bcc = s; + h2->bcc = uw_strdup(ctx, s); return h2; } @@ -132,7 +134,7 @@ uw_error(ctx, FATAL, "Duplicate Subject header"); header(ctx, s); - h2->subject = s; + h2->subject = uw_strdup(ctx, s); return h2; }