From b212f565fb1a34fdcd2f5c9530164ff4718a1a9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Wed, 30 Sep 2026 18:55:18 +0200 Subject: [PATCH] libfetch: Plug leak in 304 Not Modified case When we get a 304 Not Modified response, we need to go through the error path to properly free any resources we've allocated instead of just returning NULL directly. MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D60016 --- lib/libfetch/http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c index c5415b875155..8fe98c57446d 100644 --- a/lib/libfetch/http.c +++ b/lib/libfetch/http.c @@ -1986,7 +1986,7 @@ http_request_body(struct url *URL, const char *op, struct url_stat *us, if (conn->err == HTTP_NOT_MODIFIED) { http_seterr(HTTP_NOT_MODIFIED); - return (NULL); + goto ouch; } /* check for inconsistencies */