tftp: return error when sendto() fails

The code just called failf() and then continued without returning error.

Reported in Joshua's sarif data

Closes #18643
This commit is contained in:
Daniel Stenberg 2025-09-20 17:40:17 +02:00
parent e2d3b83244
commit 66d6075af9
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -535,11 +535,12 @@ static CURLcode tftp_send_first(struct tftp_conn *state,
(SEND_TYPE_ARG3)sbytes, 0,
CURL_SENDTO_ARG5(&remote_addr->curl_sa_addr),
(curl_socklen_t)remote_addr->addrlen);
free(filename);
if(senddata != (ssize_t)sbytes) {
char buffer[STRERROR_LEN];
failf(data, "%s", Curl_strerror(SOCKERRNO, buffer, sizeof(buffer)));
return CURLE_SEND_ERROR;
}
free(filename);
break;
case TFTP_EVENT_OACK: