summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-11-13 00:02:02 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-11-13 00:02:02 (GMT)
commitf364e7b59899fa9425bb0b281a872176facd7914 (patch)
treed516d650b1dc0c90690ab44c2732fc51862c7c8a /Parser
parentc1b0bfdb04dfd9d5c69a2a514f85213ae9b81f1b (diff)
parent9ec2593bdad44132c04ecde2a0a7c66b204450a4 (diff)
downloadcpython-f364e7b59899fa9425bb0b281a872176facd7914.zip
cpython-f364e7b59899fa9425bb0b281a872176facd7914.tar.gz
cpython-f364e7b59899fa9425bb0b281a872176facd7914.tar.bz2
Fix memory leak with FLUFL-related syntax errors (!)
Diffstat (limited to 'Parser')
-rw-r--r--Parser/parsetok.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Parser/parsetok.c b/Parser/parsetok.c
index 431a87c..f22ac67 100644
--- a/Parser/parsetok.c
+++ b/Parser/parsetok.c
@@ -190,11 +190,13 @@ parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret,
if (type == NOTEQUAL) {
if (!(ps->p_flags & CO_FUTURE_BARRY_AS_BDFL) &&
strcmp(str, "!=")) {
+ PyObject_FREE(str);
err_ret->error = E_SYNTAX;
break;
}
else if ((ps->p_flags & CO_FUTURE_BARRY_AS_BDFL) &&
strcmp(str, "<>")) {
+ PyObject_FREE(str);
err_ret->text = "with Barry as BDFL, use '<>' "
"instead of '!='";
err_ret->error = E_SYNTAX;