Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
unpackstring: Use bytes_to_utf8_temp_pv
Browse files Browse the repository at this point in the history
This will only malloc if necessary.
khwilliamson authored and scottchiefbaker committed Jan 31, 2025
1 parent 06fe63a commit 9166631
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pp_pack.c
Original file line number Diff line number Diff line change
@@ -842,8 +842,7 @@ Perl_unpackstring(pTHX_ const char *pat, const char *patend, const char *s, cons
/* We probably should try to avoid this in case a scalar context call
wouldn't get to the "U0" */
STRLEN len = strend - s;
s = (char *) bytes_to_utf8((U8 *) s, &len);
SAVEFREEPV(s);
s = (char *) bytes_to_utf8_temp_pv((U8 *) s, &len);
strend = s + len;
flags |= FLAG_DO_UTF8;
}

0 comments on commit 9166631

Please sign in to comment.