Fix memory leak with FLUFL-related syntax errors (!)

This commit is contained in:
Antoine Pitrou 2011-11-13 01:02:02 +01:00
commit f364e7b598
1 changed files with 2 additions and 0 deletions

View File

@ -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;