summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2000-06-21 09:49:51 +0000
committerdes <des@FreeBSD.org>2000-06-21 09:49:51 +0000
commitd6712064a83ba0d6a61f4eb4272d668ef426291e (patch)
tree529e07d410451ad551d2fa6b55dd90cd6b5af1c3
parent65c768f90c32314a2377128b94df239272d79b12 (diff)
downloadFreeBSD-src-d6712064a83ba0d6a61f4eb4272d668ef426291e.zip
FreeBSD-src-d6712064a83ba0d6a61f4eb4272d668ef426291e.tar.gz
Don't incorrectly report a protocol error when we get a 302 and redirects
are disabled.
-rw-r--r--lib/libfetch/http.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c
index 888b7f7..d28510d 100644
--- a/lib/libfetch/http.c
+++ b/lib/libfetch/http.c
@@ -522,7 +522,9 @@ fetchGetHTTP(struct url *URL, char *flags)
if (e != (URL->offset ? HTTP_PARTIAL : HTTP_OK)
&& (e != HTTP_MOVED || noredirect)) {
_http_seterr(e);
- goto fouch;
+ free(c);
+ fclose(f);
+ return NULL;
}
/* browse through header */
@@ -633,7 +635,8 @@ fetchStatHTTP(struct url *URL, struct url_stat *us, char *flags)
e = _http_request(f, "HEAD", URL, flags);
if (e != HTTP_OK && (e != HTTP_MOVED || noredirect)) {
_http_seterr(e);
- goto ouch;
+ fclose(f);
+ return -1;
}
while (1) {
OpenPOWER on IntegriCloud