Fix memory leak with FLUFL-related syntax errors (!)
This commit is contained in:
commit
f364e7b598
|
@ -190,11 +190,13 @@ parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret,
|
||||||
if (type == NOTEQUAL) {
|
if (type == NOTEQUAL) {
|
||||||
if (!(ps->p_flags & CO_FUTURE_BARRY_AS_BDFL) &&
|
if (!(ps->p_flags & CO_FUTURE_BARRY_AS_BDFL) &&
|
||||||
strcmp(str, "!=")) {
|
strcmp(str, "!=")) {
|
||||||
|
PyObject_FREE(str);
|
||||||
err_ret->error = E_SYNTAX;
|
err_ret->error = E_SYNTAX;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if ((ps->p_flags & CO_FUTURE_BARRY_AS_BDFL) &&
|
else if ((ps->p_flags & CO_FUTURE_BARRY_AS_BDFL) &&
|
||||||
strcmp(str, "<>")) {
|
strcmp(str, "<>")) {
|
||||||
|
PyObject_FREE(str);
|
||||||
err_ret->text = "with Barry as BDFL, use '<>' "
|
err_ret->text = "with Barry as BDFL, use '<>' "
|
||||||
"instead of '!='";
|
"instead of '!='";
|
||||||
err_ret->error = E_SYNTAX;
|
err_ret->error = E_SYNTAX;
|
||||||
|
|
Loading…
Reference in New Issue