[ruby/prism] Fix a possible malloc(0)

https://github.com/ruby/prism/commit/fa108b8626
This commit is contained in:
Haldun Bayhantopcu 2023-10-31 13:35:09 +01:00 committed by git
parent b0a2373e14
commit 3801503fe3

View File

@ -15069,7 +15069,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t
}
}
if (!interpolated) {
if (!interpolated && total_length > 0) {
void *memory = malloc(total_length);
if (!memory) abort();