void TCLinkDestroy(TCLinkHandle handle) { TCLinkCon *c = (TCLinkCon *)handle; if (!c) return; ClearSendList(c); ClearRecvList(c); Close(c); if (c->ip) free(c->ip); if (c->tc_cert) X509_free(c->tc_cert); free(c); }
void TCLinkDestroy(TCLinkHandle handle) { TCLinkCon *c = (TCLinkCon *)handle; if (!c) return; ClearSendList(c); ClearRecvList(c); Close(c); if (c->ip) free(c->ip); if (c->ssl) { SSL_free(c->ssl); c->ssl = NULL; } if (c->ctx) { SSL_CTX_free(c->ctx); c->ctx = NULL; } free(c); }