From: Christian Heimes Date: Mon, 10 Sep 2012 14:52:42 +0000 (+0200) Subject: Fixed memory leak in error branch of parsestrplus. CID 715374 Variable s going out... X-Git-Tag: v3.2.4rc1~545 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3d463393bb068a8ef8e99e00f8cb46d8a2c8631b;p=thirdparty%2FPython%2Fcpython.git Fixed memory leak in error branch of parsestrplus. CID 715374 Variable s going out of scope leaks the storage it points to. --- diff --git a/Python/ast.c b/Python/ast.c index 4ae9d75d0344..d2f063bb5ba6 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -3395,6 +3395,7 @@ parsestrplus(struct compiling *c, const node *n, int *bytesmode) goto onError; if (*bytesmode != subbm) { ast_error(n, "cannot mix bytes and nonbytes literals"); + Py_DECREF(s); goto onError; } if (PyBytes_Check(v) && PyBytes_Check(s)) {