summaryrefslogtreecommitdiffstats
path: root/src/http.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http.c')
-rw-r--r--src/http.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/http.c b/src/http.c
index 116a93a..5a5ee84 100644
--- a/src/http.c
+++ b/src/http.c
@@ -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;
}