Fixed file handle leak in OOM condition.

This commit is contained in:
Dan Fandrich 2007-04-04 22:49:12 +00:00
parent fd016fb3ee
commit 7e74349b86

View File

@ -972,6 +972,7 @@ int Curl_cookie_output(struct CookieInfo *c, char *dumphere)
format_ptr = get_netscape_format(co); format_ptr = get_netscape_format(co);
if (format_ptr == NULL) { if (format_ptr == NULL) {
fprintf(out, "#\n# Fatal libcurl error\n"); fprintf(out, "#\n# Fatal libcurl error\n");
fclose(out);
return 1; return 1;
} }
fprintf(out, "%s\n", format_ptr); fprintf(out, "%s\n", format_ptr);