bpo-39307: Fix memory leak on error path in parsetok (GH-17953)

(cherry picked from commit 7ba6f18de2)

Co-authored-by: Alex Henrie <alexhenrie24@gmail.com>
This commit is contained in:
Miss Islington (bot) 2020-01-13 02:54:24 -08:00 committed by GitHub
parent f1f0c58d38
commit 9671b6b3b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -246,6 +246,7 @@ parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret,
if ((ps = PyParser_New(g, start)) == NULL) { if ((ps = PyParser_New(g, start)) == NULL) {
err_ret->error = E_NOMEM; err_ret->error = E_NOMEM;
growable_comment_array_deallocate(&type_ignores);
PyTokenizer_Free(tok); PyTokenizer_Free(tok);
return NULL; return NULL;
} }