提交 d916ba1b 编写于 作者: N Nils Larsch

check if con != NULL before using it

上级 33af4421
...@@ -1237,8 +1237,12 @@ shut: ...@@ -1237,8 +1237,12 @@ shut:
SHUTDOWN(SSL_get_fd(con)); SHUTDOWN(SSL_get_fd(con));
ret=0; ret=0;
end: end:
if(prexit) print_stuff(bio_c_out,con,1); if (con != NULL)
if (con != NULL) SSL_free(con); {
if (prexit != 0)
print_stuff(bio_c_out,con,1);
SSL_free(con);
}
if (ctx != NULL) SSL_CTX_free(ctx); if (ctx != NULL) SSL_CTX_free(ctx);
if (cert) if (cert)
X509_free(cert); X509_free(cert);
......
...@@ -1813,13 +1813,16 @@ again: ...@@ -1813,13 +1813,16 @@ again:
} }
} }
err: err:
if (con != NULL)
{
BIO_printf(bio_s_out,"shutting down SSL\n"); BIO_printf(bio_s_out,"shutting down SSL\n");
#if 1 #if 1
SSL_set_shutdown(con,SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN); SSL_set_shutdown(con,SSL_SENT_SHUTDOWN|SSL_RECEIVED_SHUTDOWN);
#else #else
SSL_shutdown(con); SSL_shutdown(con);
#endif #endif
if (con != NULL) SSL_free(con); SSL_free(con);
}
BIO_printf(bio_s_out,"CONNECTION CLOSED\n"); BIO_printf(bio_s_out,"CONNECTION CLOSED\n");
if (buf != NULL) if (buf != NULL)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册