aboutsummaryrefslogtreecommitdiffstats
path: root/src/libpttls/pt_tls_client.c
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2013-02-18 11:45:01 +0100
committerMartin Willi <martin@revosec.ch>2013-02-28 16:46:07 +0100
commit55854ecc25c0984a39ed6ff247c7ba772d0fbe11 (patch)
treee3afcfeb36eb96dd65451326505300783c797632 /src/libpttls/pt_tls_client.c
parentbc07fef09c3df419ac1bc7c7f1e669b51e92569c (diff)
downloadstrongswan-55854ecc25c0984a39ed6ff247c7ba772d0fbe11.tar.bz2
strongswan-55854ecc25c0984a39ed6ff247c7ba772d0fbe11.tar.xz
Don't close underlying file descriptor before destroying a tls_socket
tls_socket cleanup usually sends a TLS close notify, for which it uses a valid socket.
Diffstat (limited to 'src/libpttls/pt_tls_client.c')
-rw-r--r--src/libpttls/pt_tls_client.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libpttls/pt_tls_client.c b/src/libpttls/pt_tls_client.c
index 948d92982..7f91ae691 100644
--- a/src/libpttls/pt_tls_client.c
+++ b/src/libpttls/pt_tls_client.c
@@ -276,8 +276,11 @@ METHOD(pt_tls_client_t, destroy, void,
{
if (this->tls)
{
- close(this->tls->get_fd(this->tls));
+ int fd;
+
+ fd = this->tls->get_fd(this->tls);
this->tls->destroy(this->tls);
+ close(fd);
}
this->address->destroy(this->address);
this->id->destroy(this->id);