Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 10e85de

Browse files
committed
Fixed memory leak in error branch of parsestrplus. CID 715374 Variable s going out of scope leaks the storage it points to.
2 parents c3bfb01 + 3d46339 commit 10e85de

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Python/ast.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3846,6 +3846,7 @@ parsestrplus(struct compiling *c, const node *n, int *bytesmode)
38463846
goto onError;
38473847
if (*bytesmode != subbm) {
38483848
ast_error(c, n, "cannot mix bytes and nonbytes literals");
3849+
Py_DECREF(s);
38493850
goto onError;
38503851
}
38513852
if (PyBytes_Check(v) && PyBytes_Check(s)) {

0 commit comments

Comments
 (0)