summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2012-09-10 16:53:28 +0200
committerChristian Heimes <christian@cheimes.de>2012-09-10 16:53:28 +0200
commitff2214bba43d32efd78420004e03cfaf7cbfe092 (patch)
treefc1ff85da74f734138c63d6f1489988c87217264 /Python
parentf37856025a6ab42606d34d647c43c2903e962d85 (diff)
parent6b8e6a6afd479892e11fa01c3df9879c47e03fe4 (diff)
downloadcpython-ff2214bba43d32efd78420004e03cfaf7cbfe092.tar.gz
Fixed memory leak in error branch of parsestrplus. CID 715374 Variable s going out of scope leaks the storage it points to.
Diffstat (limited to 'Python')
-rw-r--r--Python/ast.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/ast.c b/Python/ast.c
index 43c18f4aa7..0c0c1a68d9 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)) {