]> granicus.if.org Git - python/commitdiff
Fixed memory leak in error branch of parsestrplus. CID 715374 Variable s going out...
authorChristian Heimes <christian@cheimes.de>
Mon, 10 Sep 2012 14:53:28 +0000 (16:53 +0200)
committerChristian Heimes <christian@cheimes.de>
Mon, 10 Sep 2012 14:53:28 +0000 (16:53 +0200)
1  2 
Python/ast.c

diff --cc Python/ast.c
index 43c18f4aa7a6b91ba05f87b69eadbd787ab58a6f,d2f063bb5ba61db8c7754ef7caf5359459934453..0c0c1a68d9672050901257dabc61f5f601eefaad
@@@ -3845,7 -3394,8 +3845,8 @@@ parsestrplus(struct compiling *c, cons
              if (s == NULL)
                  goto onError;
              if (*bytesmode != subbm) {
 -                ast_error(n, "cannot mix bytes and nonbytes literals");
 +                ast_error(c, n, "cannot mix bytes and nonbytes literals");
+                 Py_DECREF(s);
                  goto onError;
              }
              if (PyBytes_Check(v) && PyBytes_Check(s)) {