From e5fe3fdf69bdc8a8693533af05e9a4a5d0361965 Mon Sep 17 00:00:00 2001 From: crawfordxx Date: Tue, 24 Mar 2026 12:12:19 +0800 Subject: [PATCH] api: fix missing return after error in SystemCheck handler In the SystemCheck HTTP handler, when parsing the unreferenced_layer_max_age query parameter fails, the error response is sent but execution continues to `unreferencedLayerMaximumAge = &duration` where `duration` is the zero value. This causes the system check to run with a zero duration instead of returning the 400 error to the client. Add the missing `return` after the error response. Fixes #28350 Signed-off-by: crawfordxx (cherry picked from commit 29d80a26afc89fa51fb5d173a62c70bb094653c7) Signed-off-by: Paul Holzinger --- pkg/api/handlers/libpod/system.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/api/handlers/libpod/system.go b/pkg/api/handlers/libpod/system.go index b4ff77245c..a6f4cff1cd 100644 --- a/pkg/api/handlers/libpod/system.go +++ b/pkg/api/handlers/libpod/system.go @@ -96,6 +96,7 @@ func SystemCheck(w http.ResponseWriter, r *http.Request) { if err != nil { utils.Error(w, http.StatusBadRequest, fmt.Errorf("failed to parse unreferenced_layer_max_age parameter %q for %s: %w", query.UnreferencedLayerMaximumAge, r.URL.String(), err)) + return } unreferencedLayerMaximumAge = &duration }