summaryrefslogtreecommitdiff
path: root/lib
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 23:40:50 +0200
commit8392a0cf612eaf045addc0b5d8da6d287be33907 (patch)
treeddc0e573867ddff1937d7be68b3e8b68cfc3346f /lib
parentcecffff561b4cb5707510cfbc0bc41fe0e5b346a (diff)
downloadcurl-8392a0cf612eaf045addc0b5d8da6d287be33907.tar.gz
cookie: fix memory leak if path was set twice in header
... this will let the second occurance override the first. Added test 1161 to verify. Reported-by: Max Dymond Fixes #1932 Closes #1933
Diffstat (limited to 'lib')
-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 */