Fixed file handle leak in OOM condition.
authorDan Fandrich <dan@coneharvesters.com>
Wed, 4 Apr 2007 22:49:12 +0000 (22:49 +0000)
committerDan Fandrich <dan@coneharvesters.com>
Wed, 4 Apr 2007 22:49:12 +0000 (22:49 +0000)
lib/cookie.c

index 4a33845..e64bc49 100644 (file)
@@ -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);