aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi92@disroot.org>2026-02-27 11:52:43 +0100
committerXavier Del Campo Romero <xavi92@disroot.org>2026-02-27 15:29:04 +0100
commitfca0679e438e1cf8a3db9047f57d3b2363ab417e (patch)
tree1de2b2e2115609e29007c104840e85193075e0da
parent469410001bf283b658515391514d4c2077731d04 (diff)
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
-rw-r--r--http.c4
1 files changed, 3 insertions, 1 deletions
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;
}