Issue 14761: Memleak in import.c load_source_module() (original) (raw)

Issue14761

Created on 2012-05-09 08:45 by cassou, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
fix_load_source_module_leak.patch cassou,2012-05-09 08:45 Patch that fixes a memory leak in load_source_module() from import.c
Messages (6)
msg160262 - (view) Author: Damien Cassou (cassou) Date: 2012-05-09 08:45
In load_source_module() function from import.c, it looks like Py_DECREF is not called where it should be. Please find attached a patch that fixes the leak. This bug has been found using Coccinelle (http://coccinelle.lip6.fr/) using a semantic patch (similar to https://gist.github.com/2634899).
msg160264 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-05-09 08:47
Is it 2.7-only?
msg160265 - (view) Author: Damien Cassou (cassou) Date: 2012-05-09 08:51
@pitrou I just checked Python-2.7.3 and the tip of the mercurial repository. It's not in the latter at least.
msg160271 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-05-09 11:27
New changeset a775fc27f469 by Antoine Pitrou in branch '2.7': Issue #14761: Fix potential leak on an error case in the import machinery. http://hg.python.org/cpython/rev/a775fc27f469
msg160272 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-05-09 11:30
New changeset 9de4d85e4197 by Antoine Pitrou in branch '3.2': Issue #14761: Fix potential leak on an error case in the import machinery. http://hg.python.org/cpython/rev/9de4d85e4197 New changeset 840cb46d0395 by Antoine Pitrou in branch 'default': Null merge for issue #14761. http://hg.python.org/cpython/rev/840cb46d0395
msg160274 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-05-09 11:31
Fixed, thank you!
History
Date User Action Args
2022-04-11 14:57:30 admin set github: 58966
2012-05-09 11:31:36 pitrou set status: open -> closedversions: + Python 3.2messages: + resolution: fixedstage: patch review -> resolved
2012-05-09 11:30:24 python-dev set messages: +
2012-05-09 11:27:19 python-dev set nosy: + python-devmessages: +
2012-05-09 08:51:59 cassou set messages: +
2012-05-09 08:47:59 pitrou set nosy: + pitrou, brett.cannon, ncoghlanmessages: + type: resource usagestage: patch review
2012-05-09 08:45:54 cassou create