Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b9d2e97

Browse files
authored
Fix potential memory leak in parsetok.c (GH-11832)
1 parent 3dc67d0 commit b9d2e97

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Parser/parsetok.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,6 @@ parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret,
370370
type_ignores.items[i], 0);
371371
}
372372
}
373-
growable_int_array_deallocate(&type_ignores);
374373

375374
#ifndef PGEN
376375
/* Check that the source for a single input statement really
@@ -405,6 +404,8 @@ parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret,
405404
else
406405
n = NULL;
407406

407+
growable_int_array_deallocate(&type_ignores);
408+
408409
#ifdef PY_PARSER_REQUIRES_FUTURE_KEYWORD
409410
*flags = ps->p_flags;
410411
#endif

0 commit comments

Comments
 (0)