From 7e74349b86386f0fb33e7323f70b10300d64eaf3 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Wed, 4 Apr 2007 22:49:12 +0000 Subject: Fixed file handle leak in OOM condition. --- lib/cookie.c | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/cookie.c') diff --git a/lib/cookie.c b/lib/cookie.c index 4a33845ab..e64bc49e9 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -972,6 +972,7 @@ int Curl_cookie_output(struct CookieInfo *c, char *dumphere) format_ptr = get_netscape_format(co); if (format_ptr == NULL) { fprintf(out, "#\n# Fatal libcurl error\n"); + fclose(out); return 1; } fprintf(out, "%s\n", format_ptr); -- cgit v1.2.3