diff --git a/Python/ast.c b/Python/ast.c index 43c18f4aa7a..0c0c1a68d96 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -3846,6 +3846,7 @@ parsestrplus(struct compiling *c, const node *n, int *bytesmode) goto onError; if (*bytesmode != subbm) { ast_error(c, n, "cannot mix bytes and nonbytes literals"); + Py_DECREF(s); goto onError; } if (PyBytes_Check(v) && PyBytes_Check(s)) {