]> 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:52:42 +0000 (16:52 +0200)
committerChristian Heimes <christian@cheimes.de>
Mon, 10 Sep 2012 14:52:42 +0000 (16:52 +0200)
Python/ast.c

index 4ae9d75d03440aeba79dac061469b17676dd46bb..d2f063bb5ba61db8c7754ef7caf5359459934453 100644 (file)
@@ -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)) {