Skip to content

Commit 1b5089b

Browse files
authored
Merge pull request #537 from julek-wolfssl/gh/6061
Add session ref-counting and clean up TLS resume client
2 parents b116928 + 3cfa8ba commit 1b5089b

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

tls/client-tls-resume.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,14 @@ int main(int argc, char** argv)
174174

175175

176176
/* Save the session */
177-
session = wolfSSL_get_session(ssl);
177+
session = wolfSSL_get1_session(ssl);
178178

179179
/* Close the socket */
180180
wolfSSL_free(ssl);
181+
ssl = NULL;
181182
close(sockfd);
182183

183184

184-
185185
/* --------------------------------------- *
186186
* we are now disconnected from the server *
187187
* --------------------------------------- */
@@ -275,10 +275,8 @@ int main(int argc, char** argv)
275275
/* Cleanup and return */
276276
if (ssl)
277277
wolfSSL_free(ssl); /* Free the wolfSSL object */
278-
#ifdef OPENSSL_EXTRA
279278
if (session)
280279
wolfSSL_SESSION_free(session);
281-
#endif
282280
if (sockfd != SOCKET_INVALID)
283281
close(sockfd); /* Close the socket */
284282
if (ctx)

0 commit comments

Comments
 (0)