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