summaryrefslogtreecommitdiff
path: root/node.c
diff options
context:
space:
mode:
authorPeter Zhu <[email protected]>2023-09-29 13:45:25 -0400
committerPeter Zhu <[email protected]>2023-09-29 16:51:17 -0400
commit97564ddf2baa518e4bda5b7a59111943dc13f210 ()
tree4fa31bdcfc90da6b535503e297ebed6ea4ec0ddc /node.c
parentf88f5b59e8cd58f5a88013d192c8141ea0bb8499 (diff)
Fix memory in the parser
Reproduction script: ``` require "ripper" 10.times do 20_000.times do Ripper.parse("") end puts `ps -o rss= -p #{$$}` end ``` Before: ``` 28032 34432 40704 47232 53632 60032 66432 72832 79232 85632 ``` After: ``` 21760 21760 21760 21760 21760 21760 21760 21760 21760 21760 ```
-rw-r--r--node.c4
1 files changed, 4 insertions, 0 deletions
@@ -154,6 +154,10 @@ node_buffer_list_free(rb_ast_t *ast, node_buffer_list_t * nb)
nbe = nbe->next;
xfree(buf);
}
}
struct rb_ast_local_table_link {