summaryrefslogtreecommitdiff
path: root/Parser/parsetok.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2005-11-15 04:54:23 +0000
committerNeal Norwitz <nnorwitz@gmail.com>2005-11-15 04:54:23 +0000
commit56c6561d30eb61eb75fcf494d286ccec20c14c78 (patch)
treefab5e0e693a97ee291b89fd7ecbee51aeb7f281f /Parser/parsetok.c
parent19b0f40cb122ba202af70669ccc0c6caccd9a932 (diff)
downloadcpython-git-56c6561d30eb61eb75fcf494d286ccec20c14c78.tar.gz
Prevent unlikely memory leak, tok should always be freed when parsetok() returns
Diffstat (limited to 'Parser/parsetok.c')
-rw-r--r--Parser/parsetok.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Parser/parsetok.c b/Parser/parsetok.c
index 11d2232d61..2b1255f21d 100644
--- a/Parser/parsetok.c
+++ b/Parser/parsetok.c
@@ -108,6 +108,7 @@ parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret,
if ((ps = PyParser_New(g, start)) == NULL) {
fprintf(stderr, "no mem for new parser\n");
err_ret->error = E_NOMEM;
+ PyTokenizer_Free(tok);
return NULL;
}
#if 0 /* future keyword */