683572
From 21dce8f4eb9136875a886371016aa25788f5144f Mon Sep 17 00:00:00 2001
683572
From: Karl Williamson <khw@cpan.org>
683572
Date: Tue, 6 Aug 2019 21:29:22 -0600
683572
Subject: [PATCH] locale.c: Stop Coverity warning
683572
MIME-Version: 1.0
683572
Content-Type: text/plain; charset=UTF-8
683572
Content-Transfer-Encoding: 8bit
683572
683572
Coverity is right, so re-order these clauses.  This code is executed
683572
only if some very strange error occurs.
683572
683572
Signed-off-by: Petr Písař <ppisar@redhat.com>
683572
---
683572
 locale.c | 11 ++++++-----
683572
 1 file changed, 6 insertions(+), 5 deletions(-)
683572
683572
diff --git a/locale.c b/locale.c
683572
index db83d993de..af7af60038 100644
683572
--- a/locale.c
683572
+++ b/locale.c
683572
@@ -4349,11 +4349,6 @@ Perl__mem_collxfrm(pTHX_ const char *input_string,
683572
     return xbuf;
683572
 
683572
   bad:
683572
-    Safefree(xbuf);
683572
-    if (s != input_string) {
683572
-        Safefree(s);
683572
-    }
683572
-    *xlen = 0;
683572
 
683572
 #  ifdef DEBUGGING
683572
 
683572
@@ -4363,6 +4358,12 @@ Perl__mem_collxfrm(pTHX_ const char *input_string,
683572
 
683572
 #  endif
683572
 
683572
+    Safefree(xbuf);
683572
+    if (s != input_string) {
683572
+        Safefree(s);
683572
+    }
683572
+    *xlen = 0;
683572
+
683572
     return NULL;
683572
 }
683572
 
683572
-- 
683572
2.20.1
683572