]> granicus.if.org Git - curl/commitdiff
NULL the fp pointer after it has been fclosed()
authorDaniel Stenberg <daniel@haxx.se>
Thu, 16 Dec 2004 13:55:19 +0000 (13:55 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 16 Dec 2004 13:55:19 +0000 (13:55 +0000)
lib/http.c

index 79e51b752f0bde584ad48a4c10b2108f779f9946..8e4ee7d828659a0f7971f1aa6acf7019c87ed4f6 100644 (file)
@@ -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;