summaryrefslogtreecommitdiffstats
path: root/Parser/tokenizer.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2005-10-21 06:05:33 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2005-10-21 06:05:33 (GMT)
commitc0d5faa9b4a763befbeab0159d2241a9ddf85b56 (patch)
treef852c0efe19faf5af0982d3f6f518ecf96991bf4 /Parser/tokenizer.c
parent1e8659b963ca6076a5d643da67567af7ae3bdcc6 (diff)
downloadcpython-c0d5faa9b4a763befbeab0159d2241a9ddf85b56.zip
cpython-c0d5faa9b4a763befbeab0159d2241a9ddf85b56.tar.gz
cpython-c0d5faa9b4a763befbeab0159d2241a9ddf85b56.tar.bz2
Free coding spec (cs) if there was an error to prevent mem leak. Maybe backport candidate
Diffstat (limited to 'Parser/tokenizer.c')
-rw-r--r--Parser/tokenizer.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c
index ce61322..5a9bcc0 100644
--- a/Parser/tokenizer.c
+++ b/Parser/tokenizer.c
@@ -277,11 +277,14 @@ check_coding_spec(const char* line, int size, struct tok_state *tok,
tok->encoding = cs;
tok->decoding_state = -1;
}
+ else
+ PyMem_DEL(cs);
#else
/* Without Unicode support, we cannot
process the coding spec. Since there
won't be any Unicode literals, that
won't matter. */
+ PyMem_DEL(cs);
#endif
}
} else { /* then, compare cs with BOM */