diff Python/ast.c @ 78962:4a343636c8ca 3.2

Fixed memory leak in error branch of parsestrplus. CID 715374 Variable s going out of scope leaks the storage it points to.
author Christian Heimes <christian@cheimes.de>
date Mon, 10 Sep 2012 16:52:42 +0200
parents 0c6a09b982d8
children 38830281d43b 2c9f1a578861
line wrap: on
line diff
--- a/Python/ast.c	Mon Sep 10 10:15:58 2012 -0400
+++ b/Python/ast.c	Mon Sep 10 16:52:42 2012 +0200
@@ -3395,6 +3395,7 @@
                 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)) {