From 58ebde9502cbab9215be7f0d72f08e552b7af876 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 3 Dec 2008 15:08:09 +0000 Subject: - 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) --- lib/cookie.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/cookie.c') 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); -- cgit v1.2.3