Skip to content

Commit 93490c3

Browse files
committed
Don't close an SSL socket twice
1 parent 2f53c6e commit 93490c3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

shared-module/ssl/SSLSocket.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,9 @@ void common_hal_ssl_sslsocket_bind(ssl_sslsocket_obj_t *self, mp_obj_t addr_in)
382382
}
383383

384384
void common_hal_ssl_sslsocket_close(ssl_sslsocket_obj_t *self) {
385+
if (self->closed) {
386+
return;
387+
}
385388
self->closed = true;
386389
ssl_socket_close(self);
387390
mbedtls_pk_free(&self->pkey);

0 commit comments

Comments
 (0)