classification
Title: Fix possible reference leak for sqlite3 initialization
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.10, Python 3.9, Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: corona10, erlendaasland, miss-islington
Priority: normal Keywords: patch

Created on 2020-05-22 22:16 by erlendaasland, last changed 2020-05-26 12:39 by corona10. This issue is now closed.

Files
File name Uploaded Description Edit
0001-Use-PyModule_AddObject-correctly-in-sqlite3.patch erlendaasland, 2020-05-22 22:15
Pull Requests
URL Status Linked Edit
PR 20323 merged erlendaasland, 2020-05-22 22:18
PR 20425 merged miss-islington, 2020-05-26 12:18
Messages (4)
msg369658 - (view) Author: Erlend Egeberg Aasland (erlendaasland) * Date: 2020-05-22 22:15
According to the documentation, PyModule_AddObject() only decrements the reference count of value on success. The calling code must PyDECREF() manually on error.

Fixed by attached patch.
msg369714 - (view) Author: Erlend Egeberg Aasland (erlendaasland) * Date: 2020-05-23 11:13
This issue could probably be expanded to the whole Modules directory. A lot of the modules fail to clean up properly on PyModule_AddObject() error.
msg369972 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2020-05-26 12:18
New changeset 5eb45d7d4e812e89d77da84cc619e9db81561a34 by Erlend Egeberg Aasland in branch 'master':
bpo-40737: Fix possible reference leak for sqlite3 initialization (GH-20323)
https://github.com/python/cpython/commit/5eb45d7d4e812e89d77da84cc619e9db81561a34
msg369975 - (view) Author: miss-islington (miss-islington) Date: 2020-05-26 12:38
New changeset 7df9c41c69e2af8d0d36452c09d243b0975495af by Miss Islington (bot) in branch '3.9':
bpo-40737: Fix possible reference leak for sqlite3 initialization (GH-20323)
https://github.com/python/cpython/commit/7df9c41c69e2af8d0d36452c09d243b0975495af
History
Date User Action Args
2020-05-26 12:39:23corona10setstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-05-26 12:38:54miss-islingtonsetmessages: + msg369975
2020-05-26 12:18:33miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request19683
2020-05-26 12:18:22corona10setnosy: + corona10
messages: + msg369972
2020-05-25 18:08:13erlendaaslandsettitle: Handle PyModule_AddObject() error correctly in sqlite3 -> Fix possible reference leak for sqlite3 initialization
2020-05-23 11:13:47erlendaaslandsetmessages: + msg369714
2020-05-22 22:18:08erlendaaslandsetstage: patch review
pull_requests: + pull_request19592
2020-05-22 22:16:00erlendaaslandcreate