mirror of https://github.com/eclipse/paho.mqtt.c
Free data on SSL abort write #1206
This commit is contained in:
parent
743ff1be69
commit
5bf0e00ea2
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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++)
|
||||
|
|
|
|||
Loading…
Reference in New Issue