Changelog
+Dan F (16 January 2007)
+- Fixed a small memory leak in tftp uploads discovered by curl's memory leak
+ detector. Also changed tftp downloads to URL-unescape the downloaded
+ file name.
+
Daniel (14 January 2007)
- David McCreedy provided libcurl changes for doing HTTP communication on
non-ASCII platforms. It does add some complexity, most notably with more
{
int sbytes;
const char *mode = "octet";
-
- /* As RFC3617 describes the separator slash is not actually part of the file
- name so we skip the always-present first letter of the path string. */
- char *filename = &state->conn->data->reqdata.path[1];
+ char *filename;
struct SessionHandle *data = state->conn->data;
CURLcode res = CURLE_OK;
if(data->set.upload) {
/* If we are uploading, send an WRQ */
setpacketevent(&state->spacket, TFTP_EVENT_WRQ);
- filename = curl_easy_unescape(data, filename, 0, NULL);
state->conn->data->reqdata.upload_fromhere = (char *)&state->spacket.data[4];
if(data->set.infilesize != -1)
Curl_pgrsSetUploadSize(data, data->set.infilesize);
/* If we are downloading, send an RRQ */
setpacketevent(&state->spacket, TFTP_EVENT_RRQ);
}
+ /* As RFC3617 describes the separator slash is not actually part of the
+ file name so we skip the always-present first letter of the path string. */
+ filename = curl_easy_unescape(data, &state->conn->data->reqdata.path[1], 0, NULL);
snprintf((char *)&state->spacket.data[2],
TFTP_BLOCKSIZE,
"%s%c%s%c", filename, '\0', mode, '\0');
if(sbytes < 0) {
failf(data, "%s\n", Curl_strerror(state->conn, Curl_sockerrno()));
}
+ Curl_safefree(filename);
break;
case TFTP_EVENT_ACK: /* Connected for transmit */