aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-12-16 09:52:36 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-12-16 09:52:36 +0000
commitd3b414724b18e84ed32c044527aac9a85e434690 (patch)
tree336fdd590a0b9a1aa4e246fb85c7219bcdd50312 /lib
parent38181fbc7469ea69c8679d45f5968bdac7aea935 (diff)
Dinar in bug report #1086121, found a file handle leak when a multipart
formpost (including a file upload part) was aborted before the whole file was sent.
Diffstat (limited to 'lib')
-rw-r--r--lib/http.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/http.c b/lib/http.c
index d984eddc1..79e51b752 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -1299,6 +1299,9 @@ CURLcode Curl_http_done(struct connectdata *conn,
conn->bytecount = http->readbytecount + http->writebytecount;
Curl_formclean(http->sendit); /* Now free that whole lot */
+ if(http->form.fp)
+ /* a file being uploaded was left opened, close it! */
+ fclose(http->form.fp);
}
else if(HTTPREQ_PUT == data->set.httpreq)
conn->bytecount = http->readbytecount + http->writebytecount;