Free data on SSL abort write #1206

This commit is contained in:
Ian Craggs 2022-03-04 10:48:41 +00:00
parent 743ff1be69
commit 5bf0e00ea2
3 changed files with 16 additions and 1 deletions

View File

@ -1102,4 +1102,15 @@ int SSLSocket_continueWrite(pending_writes* pw)
FUNC_EXIT_RC(rc);
return rc;
}
int SSLSocket_abortWrite(pending_writes* pw)
{
int rc = 0;
FUNC_ENTRY;
free(pw->iovecs[0].iov_base);
FUNC_EXIT_RC(rc);
return rc;
}
#endif

View File

@ -48,5 +48,6 @@ int SSLSocket_connect(SSL* ssl, SOCKET sock, const char* hostname, int verify, i
SOCKET SSLSocket_getPendingRead(void);
int SSLSocket_continueWrite(pending_writes* pw);
int SSLSocket_abortWrite(pending_writes* pw);
#endif

View File

@ -640,7 +640,7 @@ exit:
/**
* Indicate whether any data is pending outbound for a socket.
* @return boolean - true == data pending.
* @return boolean - true == no pending data.
*/
int Socket_noPendingWrites(SOCKET socket)
{
@ -1258,7 +1258,10 @@ int Socket_abortWrite(SOCKET socket)
#if defined(OPENSSL)
if (pw->ssl)
{
rc = SSLSocket_abortWrite(pw);
goto exit;
}
#endif
for (i = 0; i < pw->count; i++)