summaryrefslogtreecommitdiffstats
path: root/src/bfstd.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2023-10-26 10:57:25 -0400
committerTavian Barnes <tavianator@tavianator.com>2023-10-26 10:57:25 -0400
commit8ced65189cbea5ff0b06482713d647ca57c91f81 (patch)
tree034b68b723218b12ac0d9c5fdb92e9473e76512c /src/bfstd.c
parent70fe3b12852ca7fb5bf1529042754fc75e69baa0 (diff)
downloadbfs-8ced65189cbea5ff0b06482713d647ca57c91f81.tar.xz
bfstd: Only free the locale if we dup'd it successfully
Diffstat (limited to 'src/bfstd.c')
-rw-r--r--src/bfstd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bfstd.c b/src/bfstd.c
index ace9ed2..cdc33f1 100644
--- a/src/bfstd.c
+++ b/src/bfstd.c
@@ -302,10 +302,10 @@ const char *xstrerror(int errnum) {
if (copy != (locale_t)0) {
ret = strerror_l(errnum, copy);
- }
- if (loc == LC_GLOBAL_LOCALE) {
- freelocale(copy);
+ if (loc == LC_GLOBAL_LOCALE) {
+ freelocale(copy);
+ }
}
#endif