Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sqlite leaks on error #47403

Closed
Rhamphoryncus mannequin opened this issue Jun 20, 2008 · 2 comments
Closed

sqlite leaks on error #47403

Rhamphoryncus mannequin opened this issue Jun 20, 2008 · 2 comments
Labels
extension-modules C modules in the Modules dir performance Performance or resource usage

Comments

@Rhamphoryncus
Copy link
Mannequin

Rhamphoryncus mannequin commented Jun 20, 2008

BPO 3153
Nosy @avassalotti

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2008-07-13.22:07:09.458>
created_at = <Date 2008-06-20.21:36:05.638>
labels = ['extension-modules', 'performance']
title = 'sqlite leaks on error'
updated_at = <Date 2008-07-13.22:07:09.390>
user = 'https://bugs.python.org/Rhamphoryncus'

bugs.python.org fields:

activity = <Date 2008-07-13.22:07:09.390>
actor = 'alexandre.vassalotti'
assignee = 'none'
closed = True
closed_date = <Date 2008-07-13.22:07:09.458>
closer = 'alexandre.vassalotti'
components = ['Extension Modules']
creation = <Date 2008-06-20.21:36:05.638>
creator = 'Rhamphoryncus'
dependencies = []
files = []
hgrepos = []
issue_num = 3153
keywords = []
message_count = 2.0
messages = ['68478', '69628']
nosy_count = 2.0
nosy_names = ['Rhamphoryncus', 'alexandre.vassalotti']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = 'resource usage'
url = 'https://bugs.python.org/issue3153'
versions = []

@Rhamphoryncus
Copy link
Mannequin Author

Rhamphoryncus mannequin commented Jun 20, 2008

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.

@Rhamphoryncus Rhamphoryncus mannequin added extension-modules C modules in the Modules dir performance Performance or resource usage labels Jun 20, 2008
@avassalotti
Copy link
Member

Fixed in r64930 (trunk) and r64931 (py3k). Thanks.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension-modules C modules in the Modules dir performance Performance or resource usage
Projects
None yet
Development

No branches or pull requests

1 participant