]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: http/hardening: free the new profile on strdup() failure
authorOlivier Houchard <ohouchard@haproxy.com>
Tue, 17 Nov 2026 10:14:57 +0000 (11:14 +0100)
committerOlivier Houchard <cognet@ci0.org>
Tue, 17 Nov 2026 10:39:49 +0000 (11:39 +0100)
commit0b4bb8f447fdf8e36bee3c5d97c185dee4f1285e
tree67344a25a7f56255e860cb1ff07d7796de08f08a
parent6bf3333f7abe7cd8053022d48fa789ade0fb9788
BUG/MINOR: http/hardening: free the new profile on strdup() failure

In cfg_parse_http_hardening(), when strdup() of the file name fails after
a new profile was allocated by http_hardening_new(), the profile is not
yet indexed and its only reference is lost on "goto out", leaking it and
its name. Let's release it with http_hardening_free(), which is safe for
the static profiles.

This was reported by Coverity (CID 1690184) in GitHub issue #3560, with
the analysis and fix provided by Alexandre Laroche. It was introduced by
commit fa70a47cb ("MINOR: cfgparse/http: add a simple parser for new
section "http-fingerprint"") in 3.5-dev11, so no backport is needed.
src/http.c