summaryrefslogtreecommitdiff
path: root/src/socket.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2016-11-13 16:15:42 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2016-11-13 16:15:42 +0100
commit3c67cfb9cc024aab51d2dad11469f8c3ff5491a5 (patch)
tree8bd99e81063cb6cb1e7f686765748db29149d0e1 /src/socket.c
parent249834fa014589efe5c2b8a82a6f1e32610b3184 (diff)
downloadgnutls-3c67cfb9cc024aab51d2dad11469f8c3ff5491a5.tar.gz
sockets: only use gnutls_bye on a valid socket session
Diffstat (limited to 'src/socket.c')
-rw-r--r--src/socket.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/socket.c b/src/socket.c
index b2070878c3..4de0118b96 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -321,7 +321,8 @@ const char *starttls_proto_to_service(const char *app_proto)
void socket_bye(socket_st * socket, unsigned polite)
{
int ret;
- if (socket->secure) {
+
+ if (socket->secure && socket->session) {
if (polite) {
do
ret = gnutls_bye(socket->session, GNUTLS_SHUT_WR);