summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2005-11-15 04:54:23 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2005-11-15 04:54:23 (GMT)
commit56c6561d30eb61eb75fcf494d286ccec20c14c78 (patch)
treefab5e0e693a97ee291b89fd7ecbee51aeb7f281f /Parser
parent19b0f40cb122ba202af70669ccc0c6caccd9a932 (diff)
downloadcpython-56c6561d30eb61eb75fcf494d286ccec20c14c78.zip
cpython-56c6561d30eb61eb75fcf494d286ccec20c14c78.tar.gz
cpython-56c6561d30eb61eb75fcf494d286ccec20c14c78.tar.bz2
Prevent unlikely memory leak, tok should always be freed when parsetok() returns
Diffstat (limited to 'Parser')
-rw-r--r--Parser/parsetok.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Parser/parsetok.c b/Parser/parsetok.c
index 11d2232..2b1255f 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 */