summaryrefslogtreecommitdiffstats
path: root/src/http.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 08:56:01 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 08:56:01 +0000
commit502c540485a1626fce474639d572904a4e3c55fe (patch)
treec8bb1ed8bda9ce49697a30eaab650191e9462e2a /src/http.c
parentAdding debian version 1.21.4-1. (diff)
downloadwget-502c540485a1626fce474639d572904a4e3c55fe.tar.xz
wget-502c540485a1626fce474639d572904a4e3c55fe.zip
Merging upstream version 1.24.5.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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;
}