Require a valid con before calling terminate

If get_connection returns null, e.g., if during stop the tls_init
handler is removed from the server, con->terminate will cause a crash.
This commit is contained in:
Aydan Yumerefendi
2014-03-04 21:02:42 -05:00
parent 3ca53d0064
commit 5a5d8321bd

View File

@@ -105,7 +105,7 @@ public:
"start_accept error: "+ec.message());
}
if (ec) {
if (ec && con) {
// Terminate the connection to prevent memory leaks.
lib::error_code con_ec;
con->terminate(con_ec);