]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
http: make sure a blank header overrides accept_decoding
authorDaniel Stenberg <daniel@haxx.se>
Mon, 2 May 2016 09:24:11 +0000 (11:24 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 2 May 2016 09:24:11 +0000 (11:24 +0200)
Reported-by: rcanavan
Assisted-by: Isaac Boukris
Closes #785

lib/http.c

index f3805cc5bd53c8a3aab18af7ae42e18a8953dd35..2a7280dbad9aaffd60986618e58da6eed64252fc 100644 (file)
@@ -1917,6 +1917,10 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
     if(!conn->allocptr.accept_encoding)
       return CURLE_OUT_OF_MEMORY;
   }
+  else {
+    Curl_safefree(conn->allocptr.accept_encoding);
+    conn->allocptr.accept_encoding = NULL;
+  }
 
 #ifdef HAVE_LIBZ
   /* we only consider transfer-encoding magic if libz support is built-in */