tidying
[exim.git] / src / src / deliver.c
index a6f68825c9238569ab3deac3be91f9def0b72d4b..e931d22e92e975d30ad5bcc30b6e9e1087bcb7ef 100644 (file)
@@ -6161,13 +6161,13 @@ else if (system_filter && process_recipients != RECIP_FAIL_TIMEOUT)
           {
           uschar *tmp = expand_string(tpname);
           address_file = address_pipe = NULL;
-          uschar *m;
           if (!tmp)
             p->message = string_sprintf("failed to expand \"%s\" as a "
               "system filter transport name", tpname);
-         if (is_tainted2(tmp, 0, m = string_sprintf("Tainted values '%s' "
-              "for transport '%s' as a system filter", tmp, tpname)))
+          { uschar *m;
+         if ((m = is_tainted2(tmp, 0, "Tainted values '%s' " "for transport '%s' as a system filter", tmp, tpname)))
             p->message = m;
+          }
           tpname = tmp;
           }
         else
@@ -6554,14 +6554,19 @@ while (addr_new)           /* Loop until all addresses dealt with */
 
       /* Treat /dev/null as a special case and abandon the delivery. This
       avoids having to specify a uid on the transport just for this case.
-      Arrange for the transport name to be logged as "**bypassed**". */
+      Arrange for the transport name to be logged as "**bypassed**".
+      Copy the transport for this fairly unusual case rather than having
+      to make all transports mutable. */
 
       if (Ustrcmp(addr->address, "/dev/null") == 0)
         {
-        uschar *save = addr->transport->name;
-        addr->transport->name = US"**bypassed**";
+       transport_instance * save_t = addr->transport;
+       transport_instance * t = store_get(sizeof(*t), is_tainted(save_t));
+       *t = *save_t;
+       t->name = US"**bypassed**";
+       addr->transport = t;
         (void)post_process_one(addr, OK, LOG_MAIN, EXIM_DTYPE_TRANSPORT, '=');
-        addr->transport->name = save;
+        addr->transport= save_t;
         continue;   /* with the next new address */
         }