summaryrefslogtreecommitdiff
path: root/lib/cookie.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2017-09-30 14:10:12 +0200
committerDaniel Stenberg <daniel@haxx.se>2017-09-30 14:10:12 +0200
commit57deac5e8cb3d4cbfd01bbaea7b22c2c8f81bbf1 (patch)
treeddc0e573867ddff1937d7be68b3e8b68cfc3346f /lib/cookie.c
parentcecffff561b4cb5707510cfbc0bc41fe0e5b346a (diff)
downloadcurl-57deac5e8cb3d4cbfd01bbaea7b22c2c8f81bbf1.tar.gz
cookie: fix memory leak if path was set twice in headerbagder/cookie-leak-path-twice
... this will let the second occurance override the first. Reported-by: Max Dymond Fixes #1932
Diffstat (limited to 'lib/cookie.c')
-rw-r--r--lib/cookie.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/cookie.c b/lib/cookie.c
index 1d7defd84..271f6d49d 100644
--- a/lib/cookie.c
+++ b/lib/cookie.c
@@ -499,6 +499,7 @@ Curl_cookie_add(struct Curl_easy *data,
badcookie = TRUE; /* out of memory bad */
break;
}
+ free(co->spath); /* if this is set again */
co->spath = sanitize_cookie_path(co->path);
if(!co->spath) {
badcookie = TRUE; /* out of memory bad */