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

Skip to content

Commit 3d46339

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.
1 parent 5abd76a commit 3d46339

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
@@ -3395,6 +3395,7 @@ parsestrplus(struct compiling *c, const node *n, int *bytesmode)
33953395
goto onError;
33963396
if (*bytesmode != subbm) {
33973397
ast_error(n, "cannot mix bytes and nonbytes literals");
3398+
Py_DECREF(s);
33983399
goto onError;
33993400
}
34003401
if (PyBytes_Check(v) && PyBytes_Check(s)) {

0 commit comments

Comments
 (0)