summaryrefslogtreecommitdiffstats
path: root/Python/ast.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2012-09-10 14:52:42 (GMT)
committerChristian Heimes <christian@cheimes.de>2012-09-10 14:52:42 (GMT)
commit3d463393bb068a8ef8e99e00f8cb46d8a2c8631b (patch)
tree568c0713558a90005fbca669d8b1fcce8e358e6a /Python/ast.c
parent5abd76a75d633a1ba6f5fcc66b0bc4799b9e2eaa (diff)
downloadcpython-3d463393bb068a8ef8e99e00f8cb46d8a2c8631b.zip
cpython-3d463393bb068a8ef8e99e00f8cb46d8a2c8631b.tar.gz
cpython-3d463393bb068a8ef8e99e00f8cb46d8a2c8631b.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/ast.c')
-rw-r--r--Python/ast.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Python/ast.c b/Python/ast.c
index 4ae9d75..d2f063b 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)) {