1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-01 04:14:16 -04:00

Merge pull request #895 from janikrabe/master

Keep errstr set to NULL if errno is not set
This commit is contained in:
LemonBoy 2018-07-24 09:38:02 +02:00 committed by GitHub
commit 88f77cb6f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -842,7 +842,7 @@ int irssi_ssl_handshake(GIOChannel *handle)
return -1;
case SSL_ERROR_SYSCALL:
errstr = ERR_reason_error_string(ERR_get_error());
if (errstr == NULL && ret == -1)
if (errstr == NULL && ret == -1 && errno)
errstr = strerror(errno);
g_warning("SSL handshake failed: %s", errstr != NULL ? errstr : "server closed connection unexpectedly");
return -1;