From fca0679e438e1cf8a3db9047f57d3b2363ab417e Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Fri, 27 Feb 2026 11:52:43 +0100 Subject: http.c: Ensure valid object on freelocale(3) According to POSIX.1-2008, the behaviour is undefined if freelocale(3) is called with an invalid object. [1] [1]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/freelocale.html --- http.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/http.c b/http.c index 014dcc6..261dcc0 100644 --- a/http.c +++ b/http.c @@ -2780,7 +2780,9 @@ static int append_expire(struct dynstr *const d, const struct tm *const exp) ret = 0; end: - freelocale(l); + if (l != (locale_t)0) + freelocale(l); + return ret; } -- cgit v1.2.3