Ben Madsen reported a problem that only seemed to occur with certain specific
authorDaniel Stenberg <daniel@haxx.se>
Wed, 7 Sep 2005 11:05:34 +0000 (11:05 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 7 Sep 2005 11:05:34 +0000 (11:05 +0000)
glibc versions, and with this patch applied it no longer shows up to me. The
problem was indeed a flaw that made curl use a file handle already closed.

src/main.c

index 7ab1c94..dd197c7 100644 (file)
@@ -4159,15 +4159,15 @@ quit_curl:
   if (config->engine)
     free(config->engine);
 
+  /* cleanup the curl handle! */
+  curl_easy_cleanup(curl);
+
   if(config->headerfile && !headerfilep && heads.stream)
     fclose(heads.stream);
 
   if(allocuseragent)
     free(config->useragent);
 
-  /* cleanup the curl handle! */
-  curl_easy_cleanup(curl);
-
   if(config->trace_fopened && config->trace_stream)
     fclose(config->trace_stream);