From ebd5954461460228646540147738c3c2822ef106 Mon Sep 17 00:00:00 2001 From: Benno Rice Date: Fri, 29 Aug 2008 11:02:18 +1000 Subject: [PATCH] - Use safe_free instead of xfree. - Minor optimisation. --- src/Server.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Server.cc b/src/Server.cc index 3a2ecab9ef..51df92fa76 100644 --- a/src/Server.cc +++ b/src/Server.cc @@ -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); } } } -- 2.47.2