]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/io/syslog.h: SYSLOG_C(): Call setlocale(3) and free(3) unconditionally
authorAlejandro Colomar <alx@kernel.org>
Wed, 23 Jul 2025 00:23:57 +0000 (02:23 +0200)
committerSerge Hallyn <serge@hallyn.com>
Fri, 6 Mar 2026 01:44:32 +0000 (19:44 -0600)
Both setlocale(3) and free(3) are okay to call with a null pointer.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/io/syslog.h

index db05c31b6da4dfea6b7ef11171a9ad9c01449bc1..73fcfe26e9658f2eadcff34864b5007e382259f5 100644 (file)
                setlocale(LC_ALL, "C");                               \
                                                                      \
        syslog(__VA_ARGS__);                                          \
-       if (NULL != l_) {                                             \
-               setlocale(LC_ALL, l_);                                \
-               free(l_);                                             \
-       }                                                             \
+                                                                     \
+       setlocale(LC_ALL, l_);                                        \
+       free(l_);                                                     \
 } while (0)