mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-03 20:54:41 +02:00
fixed leak of method when ctx malloc fails; implemented get_shutdown
This commit is contained in:
19
src/ssl.c
19
src/ssl.c
@@ -134,6 +134,10 @@ CYASSL_CTX* CyaSSL_CTX_new(CYASSL_METHOD* method)
|
|||||||
ctx = NULL;
|
ctx = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
CYASSL_MSG("Alloc CTX failed, method freed");
|
||||||
|
XFREE(method, NULL, DYNAMIC_TYPE_METHOD);
|
||||||
|
}
|
||||||
|
|
||||||
CYASSL_LEAVE("CYASSL_CTX_new", 0);
|
CYASSL_LEAVE("CYASSL_CTX_new", 0);
|
||||||
return ctx;
|
return ctx;
|
||||||
@@ -5491,13 +5495,6 @@ int CyaSSL_set_compression(CYASSL* ssl)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int CyaSSL_get_shutdown(const CYASSL* ssl)
|
|
||||||
{
|
|
||||||
(void)ssl;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int CyaSSL_set_session_id_context(CYASSL* ssl, const unsigned char* id,
|
int CyaSSL_set_session_id_context(CYASSL* ssl, const unsigned char* id,
|
||||||
unsigned int len)
|
unsigned int len)
|
||||||
{
|
{
|
||||||
@@ -5515,6 +5512,14 @@ int CyaSSL_set_compression(CYASSL* ssl)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
int CyaSSL_get_shutdown(const CYASSL* ssl)
|
||||||
|
{
|
||||||
|
return (ssl->options.isClosed ||
|
||||||
|
ssl->options.connReset ||
|
||||||
|
ssl->options.sentNotify);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int CyaSSL_session_reused(CYASSL* ssl)
|
int CyaSSL_session_reused(CYASSL* ssl)
|
||||||
{
|
{
|
||||||
return ssl->options.resuming;
|
return ssl->options.resuming;
|
||||||
|
Reference in New Issue
Block a user