hostlist for router fallback_hosts must be mutable
authorJeremy Harris <jgh146exb@wizmail.org>
Sat, 15 May 2021 00:11:41 +0000 (01:11 +0100)
committerJeremy Harris <jgh146exb@wizmail.org>
Sun, 27 Jun 2021 23:30:02 +0000 (00:30 +0100)
src/src/route.c
src/src/routers/manualroute.c

index 1d87b079a7b3c6a2ecd552092581a5c71618205d..5aed06b4f4fbc2f9b1dbf0563d300fad581c0e7c 100644 (file)
@@ -288,7 +288,12 @@ for (router_instance * r = routers; r; r = r->next)
 
   /* Build a host list if fallback hosts is set. */
 
-  host_build_hostlist(&(r->fallback_hostlist), r->fallback_hosts, FALSE);
+    {
+    int old_pool = store_pool;
+    store_pool = POOL_PERM;
+    host_build_hostlist(&r->fallback_hostlist, r->fallback_hosts, FALSE);
+    store_pool = old_pool;
+    }
 
   /* Check redirect_router and pass_router are valid */
 
index 471b3856633d4c71b7ab01ea421c843553714d25..01802714ffffa5188fb660904ed1d4eccdab993b 100644 (file)
@@ -259,7 +259,7 @@ if (ob->route_list)
   int sep = -(';');             /* Default is semicolon */
   listptr = ob->route_list;
 
-  while ((route_item = string_nextinlist(&listptr, &sep, NULL, 0)) != NULL)
+  while ((route_item = string_nextinlist(&listptr, &sep, NULL, 0)))
     {
     int rc;
 
@@ -468,7 +468,7 @@ if (!addr->host_list)
 defined for these hosts. It will be a remote one, as a local transport is
 dealt with above. However, we don't need one if verifying only. */
 
-if (transport == NULL && verify == v_none)
+if (!transport && verify == v_none)
     {
     log_write(0, LOG_MAIN, "Error in %s router: no transport defined",
       rblock->name);