]> granicus.if.org Git - apache/commitdiff
'repl' is already allocated in the request pool by 'construct_host_header()' the...
authorChristophe Jaillet <jailletc36@apache.org>
Fri, 6 Jan 2017 11:52:15 +0000 (11:52 +0000)
committerChristophe Jaillet <jailletc36@apache.org>
Fri, 6 Jan 2017 11:52:15 +0000 (11:52 +0000)
So this is safe to use the 'apr_table_setn' variant in order to save a few bytes of memory.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1777593 13f79535-47bb-0310-9956-ffa450edef68

server/vhost.c

index c4bd846f7d9f5e0e5903d22113bbacb629ff030e..0de160366d755c7013cb57c7548bf1b67021fb54 100644 (file)
@@ -1163,7 +1163,7 @@ AP_DECLARE(void) ap_update_vhost_from_headers(request_rec *r)
          */
         if (have_hostname_from_url && host_header != NULL) {
             const char *repl = construct_host_header(r, is_v6literal);
-            apr_table_set(r->headers_in, "Host", repl);
+            apr_table_setn(r->headers_in, "Host", repl);
             ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(02417)
                           "Replacing host header '%s' with host '%s' given "
                           "in the request uri", host_header, repl);