[Python-checkins] cpython (merge 3.2 -> default): Fixed memory leak in error branch of parsestrplus. CID 715374 Variable s going

christian.heimes python-checkins at python.org
Mon Sep 10 16:54:15 CEST 2012


http://hg.python.org/cpython/rev/2c9f1a578861
changeset:   78963:2c9f1a578861
parent:      78960:6544fc92b528
parent:      78962:4a343636c8ca
user:        Christian Heimes <christian at cheimes.de>
date:        Mon Sep 10 16:53:28 2012 +0200
summary:
  Fixed memory leak in error branch of parsestrplus. CID 715374 Variable s going out of scope leaks the storage it points to.

files:
  Python/ast.c |  1 +
  1 files changed, 1 insertions(+), 0 deletions(-)


diff --git a/Python/ast.c b/Python/ast.c
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -3846,6 +3846,7 @@
                 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)) {

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list