From a3c6098d485e5e6a938dcab4058c12ca8f77ea03 Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <daniel@haxx.se>
Date: Mon, 13 Jun 2011 10:21:39 +0200
Subject: [PATCH] curl_formfree: close file if still open

---
 lib/formdata.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/lib/formdata.c b/lib/formdata.c
index df4094c..ba964e8 100644
--- a/lib/formdata.c
+++ b/lib/formdata.c
@@ -932,6 +932,8 @@ void curl_formfree(struct curl_httppost *form)
       free(form->contenttype); /* free the content type */
     if(form->showfilename)
       free(form->showfilename); /* free the faked file name */
+    if(form->fp) /* close open files */
+      fclose(form->fp);
     free(form);       /* free the struct */
 
   } while((form = next) != NULL); /* continue */
-- 
1.7.5.3

