summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2012-09-10 14:53:28 (GMT)
committerChristian Heimes <christian@cheimes.de>2012-09-10 14:53:28 (GMT)
commit10e85ded9bd2d8dabb06a67ab21010ad75f430d1 (patch)
tree75613b3e08d906729bbeb5510fe7db299ddd8c15 /Python
parentc3bfb01a959235135c727d532e3e89bbf2658a09 (diff)
parent3d463393bb068a8ef8e99e00f8cb46d8a2c8631b (diff)
downloadcpython-10e85ded9bd2d8dabb06a67ab21010ad75f430d1.zip
cpython-10e85ded9bd2d8dabb06a67ab21010ad75f430d1.tar.gz
cpython-10e85ded9bd2d8dabb06a67ab21010ad75f430d1.tar.bz2
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 43c18f4..0c0c1a6 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)) {