- 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)
This commit is contained in:
Daniel Stenberg
2008-12-03 15:08:09 +00:00
parent 04ee89493e
commit 58ebde9502
3 changed files with 9 additions and 2 deletions

View File

@@ -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);