Commit 6d29352
committed
Issue #15895: my analysis was slightly off. The FILE pointer is only leaked when set_main_loader() fails for a pyc file with closeit=0. In the success case run_pyc_file() does its own cleanup of the fp. I've changed the code to use another FILE ptr for pyc files and moved the fclose() to PyRun_SimpleFileExFlags() to make it more obvious what's happening.
1 parent 6a77af6 commit 6d29352
2 files changed
Lines changed: 8 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1385 | 1385 | | |
1386 | 1386 | | |
1387 | 1387 | | |
1388 | | - | |
| 1388 | + | |
1389 | 1389 | | |
1390 | 1390 | | |
1391 | 1391 | | |
| |||
1411 | 1411 | | |
1412 | 1412 | | |
1413 | 1413 | | |
| 1414 | + | |
1414 | 1415 | | |
1415 | 1416 | | |
1416 | 1417 | | |
1417 | | - | |
| 1418 | + | |
1418 | 1419 | | |
1419 | 1420 | | |
1420 | 1421 | | |
1421 | 1422 | | |
1422 | | - | |
1423 | 1423 | | |
1424 | 1424 | | |
1425 | 1425 | | |
1426 | 1426 | | |
1427 | 1427 | | |
1428 | 1428 | | |
1429 | 1429 | | |
| 1430 | + | |
1430 | 1431 | | |
1431 | 1432 | | |
1432 | | - | |
| 1433 | + | |
| 1434 | + | |
1433 | 1435 | | |
1434 | 1436 | | |
1435 | 1437 | | |
| |||
1450 | 1452 | | |
1451 | 1453 | | |
1452 | 1454 | | |
1453 | | - | |
1454 | | - | |
1455 | | - | |
1456 | 1455 | | |
1457 | 1456 | | |
1458 | 1457 | | |
| |||
1999 | 1998 | | |
2000 | 1999 | | |
2001 | 2000 | | |
2002 | | - | |
2003 | 2001 | | |
2004 | 2002 | | |
2005 | 2003 | | |
| |||
0 commit comments