[New-bugs-announce] [issue31740] refleaks when calling sqlite3.Connection.__init__() more than once

Oren Milman report at bugs.python.org
Mon Oct 9 16:32:17 EDT 2017


New submission from Oren Milman <orenmn at gmail.com>:

The following code causes refleaks:
import sqlite3
connection = sqlite3.Connection.__new__(sqlite3.Connection)
connection.__init__('foo')
connection.__init__('foo')

This is because pysqlite_connection_init() (in Modules/_sqlite/connection.c)
doesn't decref (if needed) before assigning to various fields of `self`.

I would open a PR to fix this soon.

----------
components: Extension Modules
messages: 303997
nosy: Oren Milman
priority: normal
severity: normal
status: open
title: refleaks when calling sqlite3.Connection.__init__() more than once
type: resource usage
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31740>
_______________________________________


More information about the New-bugs-announce mailing list