diff options
author | Daniel Stenberg <daniel@haxx.se> | 2008-12-03 15:08:09 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2008-12-03 15:08:09 +0000 |
commit | 58ebde9502cbab9215be7f0d72f08e552b7af876 (patch) | |
tree | 7f7692116e7ec1a8e455b59519f32fcafff18cb7 /lib/cookie.c | |
parent | 04ee89493ec3923ee5de19366fd25e6ac5f97423 (diff) |
- Pawel Kierski pointed out a mistake in the cookie code that could lead to a
bad fclose() after a fatal error had occured.
(http://curl.haxx.se/bug/view.cgi?id=2382219)
Diffstat (limited to 'lib/cookie.c')
-rw-r--r-- | lib/cookie.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/cookie.c b/lib/cookie.c index b117f2f8b..4db1a5621 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -1003,7 +1003,8 @@ int Curl_cookie_output(struct CookieInfo *c, const char *dumphere) format_ptr = get_netscape_format(co); if(format_ptr == NULL) { fprintf(out, "#\n# Fatal libcurl error\n"); - fclose(out); + if(!use_stdout) + fclose(out); return 1; } fprintf(out, "%s\n", format_ptr); |