summaryrefslogtreecommitdiffstats
path: root/Utilities/cmcurl/cookie.c
diff options
context:
space:
mode:
authorÖmer Fadıl USTA <omerusta@gmail.com>2013-07-12 14:23:55 (GMT)
committerBrad King <brad.king@kitware.com>2013-07-15 14:20:00 (GMT)
commitc8adab9e4344a5ef96d902cf11c938d15aff15fc (patch)
tree29bcb489aa5814fecd699de7990aa71899502771 /Utilities/cmcurl/cookie.c
parent499531c64e0cd3a6834616af576d612e8678e4d9 (diff)
downloadCMake-c8adab9e4344a5ef96d902cf11c938d15aff15fc.zip
CMake-c8adab9e4344a5ef96d902cf11c938d15aff15fc.tar.gz
CMake-c8adab9e4344a5ef96d902cf11c938d15aff15fc.tar.bz2
cmcurl: Fix resource leak reported by cppcheck
Add missing fclose calls. Reviewed-by: Igor Murzov <e-mail@date.by>
Diffstat (limited to 'Utilities/cmcurl/cookie.c')
-rw-r--r--Utilities/cmcurl/cookie.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Utilities/cmcurl/cookie.c b/Utilities/cmcurl/cookie.c
index 2856ad8..d8ea241 100644
--- a/Utilities/cmcurl/cookie.c
+++ b/Utilities/cmcurl/cookie.c
@@ -969,6 +969,8 @@ 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");
+ if(!use_stdout)
+ fclose(out);
return 1;
}
fprintf(out, "%s\n", format_ptr);