Skip to content

Commit 87191dc

Browse files
committed
unpackstring: Use bytes_to_utf8_temp_pv
This will only malloc if necessary.
1 parent dd06810 commit 87191dc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pp_pack.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -842,8 +842,7 @@ Perl_unpackstring(pTHX_ const char *pat, const char *patend, const char *s, cons
842842
/* We probably should try to avoid this in case a scalar context call
843843
wouldn't get to the "U0" */
844844
STRLEN len = strend - s;
845-
s = (char *) bytes_to_utf8((U8 *) s, &len);
846-
SAVEFREEPV(s);
845+
s = (char *) bytes_to_utf8_temp_pv((U8 *) s, &len);
847846
strend = s + len;
848847
flags |= FLAG_DO_UTF8;
849848
}

0 commit comments

Comments
 (0)