]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
locale-util: fix argument for munmap()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 11 Apr 2025 00:11:05 +0000 (09:11 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 12 Apr 2025 19:59:26 +0000 (04:59 +0900)
src/basic/locale-util.c

index c7095ece2397765ba0f5cf9f80f2e92341d1a2ab..45ba70f04d710f93106a9e7ff357d78877fcf840 100644 (file)
@@ -97,7 +97,6 @@ static int add_locales_from_archive(Set *locales) {
         const struct namehashent *e;
         const void *p = MAP_FAILED;
         _cleanup_close_ int fd = -EBADF;
-        size_t sz = 0;
         struct stat st;
         int r;
 
@@ -154,9 +153,9 @@ static int add_locales_from_archive(Set *locales) {
 
         r = 0;
 
- finish:
+finish:
         if (p != MAP_FAILED)
-                munmap((void*) p, sz);
+                munmap((void*) p, st.st_size);
 
         return r;
 }