diff options
author | John Hawthorn <[email protected]> | 2024-12-11 15:23:25 -0800 |
---|---|---|
committer | John Hawthorn <[email protected]> | 2024-12-11 16:30:57 -0800 |
commit | 54f8e6fbbcdbe3162e39b5053b0ebbf872fc2d77 () | |
tree | 4f9a65ca17b15872c80a00910817662785d9965c /prism_compile.c | |
parent | d84859061a39b81b85bdbae8cfff5088a5c78a93 (diff) |
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 <[email protected]> Co-authored-by: Matthew Draper <[email protected]>
Notes: Merged: https://.com/ruby/ruby/pull/12312
-rw-r--r-- | prism_compile.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); memcpy(source, RSTRING_PTR(contents), length); *string = (pm_string_t) { .type = PM_STRING_OWNED, .source = source, .length = length }; |