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