Merge pull request #537 from julek-wolfssl/gh/6061

Add session ref-counting and clean up TLS resume client
devin/1766079702-dtls-session-export
Eric Blankenhorn 2025-12-12 09:34:13 -06:00 committed by GitHub
commit 1b5089b5cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 4 deletions

View File

@ -174,14 +174,14 @@ int main(int argc, char** argv)
/* Save the session */
session = wolfSSL_get_session(ssl);
session = wolfSSL_get1_session(ssl);
/* Close the socket */
wolfSSL_free(ssl);
ssl = NULL;
close(sockfd);
/* --------------------------------------- *
* we are now disconnected from the server *
* --------------------------------------- */
@ -275,10 +275,8 @@ exit:
/* Cleanup and return */
if (ssl)
wolfSSL_free(ssl); /* Free the wolfSSL object */
#ifdef OPENSSL_EXTRA
if (session)
wolfSSL_SESSION_free(session);
#endif
if (sockfd != SOCKET_INVALID)
close(sockfd); /* Close the socket */
if (ctx)