From: Christian Heimes Date: Mon, 10 Sep 2012 14:53:28 +0000 (+0200) Subject: Fixed memory leak in error branch of parsestrplus. CID 715374 Variable s going out... X-Git-Tag: v3.3.1rc1~818^2^2~102 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=10e85ded9bd2d8dabb06a67ab21010ad75f430d1;p=python Fixed memory leak in error branch of parsestrplus. CID 715374 Variable s going out of scope leaks the storage it points to. --- 10e85ded9bd2d8dabb06a67ab21010ad75f430d1 diff --cc Python/ast.c index 43c18f4aa7,d2f063bb5b..0c0c1a68d9 --- a/Python/ast.c +++ b/Python/ast.c @@@ -3845,7 -3394,8 +3845,8 @@@ parsestrplus(struct compiling *c, cons if (s == NULL) goto onError; if (*bytesmode != subbm) { - ast_error(n, "cannot mix bytes and nonbytes literals"); + ast_error(c, n, "cannot mix bytes and nonbytes literals"); + Py_DECREF(s); goto onError; } if (PyBytes_Check(v) && PyBytes_Check(s)) {