]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
- Use safe_free instead of xfree.
authorBenno Rice <benno@squid-cache.org>
Fri, 29 Aug 2008 01:02:18 +0000 (11:02 +1000)
committerBenno Rice <benno@squid-cache.org>
Fri, 29 Aug 2008 01:02:18 +0000 (11:02 +1000)
- Minor optimisation.

src/Server.cc

index 3a2ecab9efcb9a897b1817b88cb96f60596e207f..51df92fa766b7528868d6628013af510d971b342 100644 (file)
@@ -409,11 +409,13 @@ purgeEntriesByHeader(const HttpRequest *req, const char *reqUrl, HttpMsg *rep, h
            if (absUrl != NULL) {
                url = absUrl;
            }
-        if (sameUrlHosts(reqUrl, url)) { // prevent purging DoS, per RFC 2616
+           if (absUrl != NULL) { // if the URL was relative, it is by nature the same host
+            purgeEntriesByUrl(url);
+           } else if (sameUrlHosts(reqUrl, url)) { // prevent purging DoS, per RFC 2616 13.10, second last paragraph
             purgeEntriesByUrl(url);
         }
         if (absUrl != NULL) {
-            xfree((void *)absUrl);
+            safe_free((void *)absUrl);
         }
     }
 }