This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add Perl_setlocale()
[perl5.git] / ext / POSIX / POSIX.xs
index 2d3e69f..f54ca26 100644 (file)
@@ -2237,15 +2237,11 @@ setlocale(category, locale = 0)
     PREINIT:
        char *          retval;
     CODE:
-       retval = Perl_setlocale(category, locale);
-        if (! retval) { /* Should never happen that a query would return an
-                         * error, but be sure */
+       retval = (char *) Perl_setlocale(category, locale);
+        if (! retval) {
             XSRETURN_UNDEF;
         }
 
-        /* Make sure the returned copy gets cleaned up */
-        SAVEFREEPV(retval);
-
         RETVAL = retval;
     OUTPUT:
        RETVAL