]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Do not leak url_rewrite_extras and store_id_extras on reconfigure/shutdown.
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 23 Sep 2016 11:22:48 +0000 (23:22 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 23 Sep 2016 11:22:48 +0000 (23:22 +1200)
TODO: We should not create unneeded extras either.

src/redirect.cc

index d28a910a98a8fdd26f01ad37fe61e84cd03eb893..5fb6913c4b0ffcacb111c58897680a824aa94b0f 100644 (file)
@@ -369,11 +369,13 @@ redirectInit(void)
     }
 
     if (Config.redirector_extras) {
+        delete redirectorExtrasFmt;
         redirectorExtrasFmt = new ::Format::Format("url_rewrite_extras");
         (void)redirectorExtrasFmt->parse(Config.redirector_extras);
     }
 
     if (Config.storeId_extras) {
+        delete storeIdExtrasFmt;
         storeIdExtrasFmt = new ::Format::Format("store_id_extras");
         (void)storeIdExtrasFmt->parse(Config.storeId_extras);
     }
@@ -388,9 +390,6 @@ redirectShutdown(void)
      * When and if needed for more helpers a separated shutdown
      * method will be added for each of them.
      */
-    if (!storeIds && !redirectors)
-        return;
-
     if (redirectors)
         helperShutdown(redirectors);