diff options
Diffstat (limited to 'src/http.c')
-rw-r--r-- | src/http.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -1,5 +1,5 @@ /* HTTP support. - Copyright (C) 1996-2012, 2014-2015, 2018-2023 Free Software + Copyright (C) 1996-2012, 2014-2015, 2018-2024 Free Software Foundation, Inc. This file is part of GNU Wget. @@ -4164,7 +4164,11 @@ gethttp (const struct url *u, struct url *original_url, struct http_stat *hs, err = open_output_stream (hs, count, &fp); if (err != RETROK) { + /* Make sure that errno doesn't get clobbered. + * This is the case for OpenSSL's SSL_shutdown(). */ + int tmp_errno = errno; CLOSE_INVALIDATE (sock); + errno = tmp_errno; retval = err; goto cleanup; } |