]> granicus.if.org Git - curl/commitdiff
Fixed a TFTP memory leak. Enabled test 2003 to verify this.
authorDaniel Stenberg <daniel@haxx.se>
Thu, 25 Oct 2007 07:47:38 +0000 (07:47 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 25 Oct 2007 07:47:38 +0000 (07:47 +0000)
CHANGES
RELEASE-NOTES
lib/tftp.c
tests/data/DISABLED

diff --git a/CHANGES b/CHANGES
index e6cc37a69254a8fe2f31b6fe7d6d7ad6b4427ecc..ab7cce15bbac6c9093847dc9ad757f32cc1a8825 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,11 @@
 
                                   Changelog
 
+Daniel S (25 October 2007)
+- Fixed a few memory leaks when the same easy handle is re-used to request
+  URLs with different protocols. FTP and TFTP related leaks. Caught thanks to
+  Dan F's new test cases.
+
 Dan F (24 October 2007)
 - Fixed the test FTP and TFTP servers to support the >10000 test number
   notation
index c35f94710ee5daf7b6b34e08b0243f13488ebd41..efd7e730a61cb69145f82fd908b51626c4763601 100644 (file)
@@ -40,7 +40,7 @@ This release includes the following bugfixes:
  o CURLOPT_POSTFIELDS could fail to send binary data
  o specifying a proxy with a trailing slash didn't work (unless it also
    contained a port number)
- o redirect from HTTP to FTP memory problem
+ o redirect from HTTP to FTP or TFTP memory problems and leaks
  o re-used connections a bit too much when using non-SSL protocols tunneled
    over a HTTP proxy
  o embed the manifest in VC8 builds
index ba78422800bc83346af9556d40b81efccb5a716c..041a5f340e82cb93d646c92fbcc7552f52c6f544 100644 (file)
@@ -605,9 +605,13 @@ static CURLcode tftp_state_machine(tftp_state_data_t *state,
 static CURLcode Curl_tftp_connect(struct connectdata *conn, bool *done)
 {
   CURLcode code;
-  tftp_state_data_t     *state;
+  tftp_state_data_t *state;
   int rc;
 
+  /* If there already is a protocol-specific struct allocated for this
+     sessionhandle, deal with it */
+  Curl_reset_reqproto(conn);
+
   state = conn->data->reqdata.proto.tftp = calloc(sizeof(tftp_state_data_t),
                                                   1);
   if(!state)
index a655a70b9e2e698e51f14c9e2f966eb36ae88e67..95953eab345445837d81d09c20f8cffdcff98126 100644 (file)
@@ -4,4 +4,3 @@
 # per line.
 # Lines starting with '#' letters are treated as comments.
 #1009
-2003