NULL the fp pointer after it has been fclosed()

This commit is contained in:
Daniel Stenberg 2004-12-16 13:55:19 +00:00
Родитель d3b414724b
Коммит 494c40fd98
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -1299,9 +1299,11 @@ 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)
if(http->form.fp) {
/* a file being uploaded was left opened, close it! */
fclose(http->form.fp);
http->form.fp = NULL;
}
}
else if(HTTPREQ_PUT == data->set.httpreq)
conn->bytecount = http->readbytecount + http->writebytecount;