From 9feff567ae4e6d700402895ceccb1aad1cd0474f Mon Sep 17 00:00:00 2001 From: "Alan M. Carroll" Date: Mon, 7 Nov 2016 15:27:12 -0600 Subject: [PATCH] Remove unneeded malloc from url_rewrite debug path for HOST header. --- proxy/http/remap/RemapProcessor.cc | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/proxy/http/remap/RemapProcessor.cc b/proxy/http/remap/RemapProcessor.cc index f557c52551d..fd9426e2adc 100644 --- a/proxy/http/remap/RemapProcessor.cc +++ b/proxy/http/remap/RemapProcessor.cc @@ -240,18 +240,11 @@ RemapProcessor::finish_remap(HttpTransact::State *s) const char *host_hdr = request_header->value_get(MIME_FIELD_HOST, MIME_LEN_HOST, &host_len); if (request_url && host_hdr != nullptr && s->txn_conf->maintain_pristine_host_hdr == 0) { - // Debug code to print out old host header. This was easier before - // the header conversion. Now we have to copy to gain null - // termination for the Debug() call if (is_debug_tag_set("url_rewrite")) { int old_host_hdr_len; char *old_host_hdr = (char *)request_header->value_get(MIME_FIELD_HOST, MIME_LEN_HOST, &old_host_hdr_len); - - if (old_host_hdr) { - old_host_hdr = ats_strndup(old_host_hdr, old_host_hdr_len); + if (old_host_hdr) Debug("url_rewrite", "Host: Header before rewrite %.*s", old_host_hdr_len, old_host_hdr); - ats_free(old_host_hdr); - } } // // Create the new host header field being careful that our