classification
Title: sqlite leaks on error
Type: resource usage Stage:
Components: Extension Modules Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Rhamphoryncus, alexandre.vassalotti
Priority: normal Keywords:

Created on 2008-06-20 21:36 by Rhamphoryncus, last changed 2008-07-13 22:07 by alexandre.vassalotti. This issue is now closed.

Messages (2)
msg68478 - (view) Author: Adam Olsen (Rhamphoryncus) Date: 2008-06-20 21:36
Found in Modules/_sqlite/cursor.c:

        self->statement = PyObject_New(pysqlite_Statement,
&pysqlite_StatementTy
pe);
        if (!self->statement) {
            goto error;
        }
        rc = pysqlite_statement_create(self->statement,
self->connection, operation);
        if (rc != SQLITE_OK) {
            self->statement = 0;
            goto error;
        }

Besides the ugliness of allocating the object before passing it to the
"create" function, if pysqlite_statement_create fails, the object is leaked.
msg69628 - (view) Author: Alexandre Vassalotti (alexandre.vassalotti) * (Python committer) Date: 2008-07-13 22:07
Fixed in r64930 (trunk) and r64931 (py3k). Thanks.
History
Date User Action Args
2008-07-13 22:07:09alexandre.vassalottisetstatus: open -> closed
resolution: fixed
messages: + msg69628
nosy: + alexandre.vassalotti
2008-06-20 21:36:05Rhamphoryncuscreate