call ssl_socket_close for ssl sockets (#14903)

This commit is contained in:
Jamiras 2023-01-25 08:17:41 -07:00 committed by GitHub
parent 4d5bea1208
commit 0ec1a6acfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1211,14 +1211,16 @@ void net_http_delete(struct http_t *state)
if (state->sock_state.fd >= 0)
{
socket_close(state->sock_state.fd);
#ifdef HAVE_SSL
if (state->sock_state.ssl && state->sock_state.ssl_ctx)
{
ssl_socket_close(state->sock_state.ssl_ctx);
ssl_socket_free(state->sock_state.ssl_ctx);
state->sock_state.ssl_ctx = NULL;
}
else
#endif
socket_close(state->sock_state.fd);
}
free(state);
}