]> granicus.if.org Git - curl/commitdiff
sepheaders.c: Fixed resource leak on failure
authorJulien Nabet <serval2412@yahoo.fr>
Wed, 31 Dec 2014 10:40:28 +0000 (11:40 +0100)
committerSteve Holme <steve_holme@hotmail.com>
Wed, 31 Dec 2014 11:14:22 +0000 (11:14 +0000)
docs/examples/sepheaders.c

index 63ea99391e3410abb29755aad436ba00e7e9502f..e085f5177b86683b3b62d04c5bbc9ddde6388207 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution. The terms
@@ -62,6 +62,7 @@ int main(void)
   bodyfile = fopen(bodyfilename,"wb");
   if (bodyfile == NULL) {
     curl_easy_cleanup(curl_handle);
+    fclose(headerfile);
     return -1;
   }