From d3b414724b18e84ed32c044527aac9a85e434690 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 16 Dec 2004 09:52:36 +0000 Subject: 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. --- lib/http.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') 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; -- cgit v1.2.3