+++ /dev/null
-Make the bounce error message buffer dynamic. The rest of this comment
-is left over from when this read "Provide the proper bounce error message".
-
-This may not be the best solution - the error message buffer has now
-turned dynamic, but the only alternative I see is to make it a static
-array in net.c... and I'm not quite sure if I want to do that just now.
-
---- a/dma.c
-+++ b/dma.c
-@@ -590,7 +590,7 @@
- }
-
- static void
--bounce(struct qitem *it, const char *reason)
-+bounce(struct qitem *it, char *reason)
- {
- struct queue bounceq;
- struct qitem *bit;
-@@ -751,6 +751,7 @@
- config->features & FULLBOUNCE ?
- "Original message follows." :
- "Message headers follow.");
-+ free(reason);
- if (error < 0)
- goto fail;
- if (fflush(bit->queuef) != 0)
-@@ -834,7 +835,7 @@
- #endif
-
- static int
--deliver_local(struct qitem *it, const char **errmsg)
-+deliver_local(struct qitem *it, char **errmsg)
- {
- char fn[PATH_MAX+1];
- char line[1000];
-@@ -917,7 +918,7 @@
- #ifdef HAVE_LIBLOCKFILE
- mailunlock();
- #endif
-- *errmsg = "corrupted queue file";
-+ *errmsg = strdup("corrupted queue file");
- error = -1;
- goto chop;
- }
-@@ -960,7 +961,7 @@
- {
- int error;
- unsigned int backoff = MIN_RETRY;
-- const char *errmsg = "unknown bounce reason";
-+ char *errmsg = strdup("unknown bounce reason");
- struct timeval now;
- struct stat st;
-
---- a/dma.h
-+++ b/dma.h
-@@ -165,7 +165,7 @@
- extern char *ssl_errstr(void);
- extern int read_remote(int, int, char *);
- extern ssize_t send_remote_command(int, const char*, ...);
--extern int deliver_remote(struct qitem *, const char **);
-+extern int deliver_remote(struct qitem *, char **);
-
- /* base64.c */
- extern int base64_encode(const void *, int, char **);
---- a/net.c
-+++ b/net.c
-@@ -347,7 +347,7 @@
- }
-
- int
--deliver_remote(struct qitem *it, const char **errmsg)
-+deliver_remote(struct qitem *it, char **errmsg)
- {
- struct authuser *a;
- char *host, line[1000];
-@@ -474,7 +474,7 @@
- if (linelen == 0 || line[linelen - 1] != '\n') {
- syslog(LOG_CRIT, "%s: remote delivery failed:"
- "corrupted queue file", it->queueid);
-- *errmsg = "corrupted queue file";
-+ *errmsg = strdup("corrupted queue file");
- error = -1;
- goto out;
- }