Use malloc for prism string source
Prism will later free this string via free rather than xfree, so we need to use malloc rather than xmalloc. Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org> Co-authored-by: Matthew Draper <matthew@trebex.net>
This commit is contained in:
parent
d84859061a
commit
54f8e6fbbc
Notes:
git
2025-06-06 00:31:58 +00:00
@ -10840,7 +10840,7 @@ pm_read_file(pm_string_t *string, const char *filepath)
|
||||
}
|
||||
|
||||
size_t length = (size_t) len;
|
||||
uint8_t *source = xmalloc(length);
|
||||
uint8_t *source = malloc(length);
|
||||
memcpy(source, RSTRING_PTR(contents), length);
|
||||
*string = (pm_string_t) { .type = PM_STRING_OWNED, .source = source, .length = length };
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user