Skip to content

Commit 686e0cc

Browse files
committed
Free the parser if alloc_parser raises
1 parent 9cf3d98 commit 686e0cc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ext/rbs_extension/parserstate.c

+1
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ parserstate *alloc_parser(VALUE buffer, lexstate *lexer, int start_pos, int end_
363363

364364
if (!NIL_P(variables)) {
365365
if (!RB_TYPE_P(variables, T_ARRAY)) {
366+
free_parser(parser);
366367
rb_raise(rb_eTypeError,
367368
"wrong argument type %"PRIsVALUE" (must be array or nil)",
368369
rb_obj_class(variables));

0 commit comments

Comments
 (0)