From 3d463393bb068a8ef8e99e00f8cb46d8a2c8631b Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Mon, 10 Sep 2012 16:52:42 +0200 Subject: [PATCH] Fixed memory leak in error branch of parsestrplus. CID 715374 Variable s going out of scope leaks the storage it points to. --- Python/ast.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Python/ast.c b/Python/ast.c index 4ae9d75d034..d2f063bb5ba 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)) {