libssh: Remove free done for sftp_send_aio for successful write

libssh's sftp_aio_wait_write() would free the sftp_aio
and assign NULL to the variable storing it in case of
success and error (not in case of SSH_AGAIN).

Hence freeing sftp_send_aio and assigning it NULL is
not needed in case of successful sftp_aio_wait_write()
due to which this commit removes that code.

Signed-off-by: Eshan Kelkar <eshankelkar@galorithm.com>
This commit is contained in:
Eshan Kelkar 2025-05-27 20:38:12 +05:30
parent 91278dec41
commit b81d51e904

View file

@ -3047,10 +3047,13 @@ static CURLcode sftp_send(struct Curl_easy *data, int sockindex,
return CURLE_AGAIN;
else if(nwrite < 0)
return CURLE_SEND_ERROR;
if(sshc->sftp_send_aio) {
sftp_aio_free(sshc->sftp_send_aio);
sshc->sftp_send_aio = NULL;
}
/*
* sftp_aio_wait_write() would free sftp_send_aio and
* assign it NULL in all cases except when it returns
* SSH_AGAIN.
*/
sshc->sftp_send_state = 0;
*pnwritten = (size_t)nwrite;
return CURLE_OK;