]> granicus.if.org Git - curl/commitdiff
reuse_conn(): free old_conn->options
authorEven Rouault <even.rouault@spatialys.com>
Wed, 25 Jul 2018 09:22:51 +0000 (11:22 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 26 Jul 2018 14:20:15 +0000 (16:20 +0200)
This fixes a memory leak when CURLOPT_LOGIN_OPTIONS is used, together with
connection reuse.

I found this with oss-fuzz on GDAL and curl master:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9582
I couldn't reproduce with the oss-fuzz original test case, but looking
at curl source code pointed to this well reproducable leak.

Closes #2790

lib/url.c

index 5f520e91e19b55b039061a3835d8f9ad57cb074f..04f46b45f3cc3018e60b0673cf4c3730a0a7e50e 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -3971,6 +3971,7 @@ static void reuse_conn(struct connectdata *old_conn,
 
   Curl_safefree(old_conn->user);
   Curl_safefree(old_conn->passwd);
+  Curl_safefree(old_conn->options);
   Curl_safefree(old_conn->http_proxy.user);
   Curl_safefree(old_conn->socks_proxy.user);
   Curl_safefree(old_conn->http_proxy.passwd);