From 8ced65189cbea5ff0b06482713d647ca57c91f81 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 26 Oct 2023 10:57:25 -0400 Subject: bfstd: Only free the locale if we dup'd it successfully --- src/bfstd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/bfstd.c') 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 -- cgit v1.2.3