cookie: fix memory leak on oversized rejection

Regression brought by 2bc230de63

Detected by OSS-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3513
Assisted-by: Max Dymond

Closes #1930
This commit is contained in:
Daniel Stenberg 2017-09-29 08:50:15 +02:00
parent 49d75a4c15
commit 20ea22ff73
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -438,7 +438,7 @@ Curl_cookie_add(struct Curl_easy *data,
/* too long individual name or contents, or too long combination of /* too long individual name or contents, or too long combination of
name + contents. Chrome and Firefox support 4095 or 4096 bytes name + contents. Chrome and Firefox support 4095 or 4096 bytes
combo. */ combo. */
free(co); freecookie(co);
infof(data, "oversized cookie dropped, name/val %d + %d bytes\n", infof(data, "oversized cookie dropped, name/val %d + %d bytes\n",
nlen, len); nlen, len);
return NULL; return NULL;