]> 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 00:13:32 +0000 (18:13 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Fri, 23 Sep 2016 00:13:32 +0000 (18:13 -0600)
TODO: We should not create unneeded extras either.

src/redirect.cc

index 5098283528431795b65dbb773e1c92ebd5ad1498..619f987532b97f0a3ab7816ef616a89fa693b34a 100644 (file)
@@ -395,11 +395,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);
     }
@@ -414,9 +416,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);