Skip to content

Commit 9893920

Browse files
author
neal.norwitz
committed
Fix valgrind problem with invalid memory read
git-svn-id: http://svn.python.org/projects/python/trunk@45451 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent e0eb2e2 commit 9893920

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

Modules/_sqlite/statement.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ int statement_create(Statement* self, Connection* connection, PyObject* sql)
4747
PyObject* sql_str;
4848
char* sql_cstr;
4949

50-
self->st = NULL;
51-
5250
self->st = NULL;
5351
self->in_use = 0;
5452

@@ -80,6 +78,7 @@ int statement_create(Statement* self, Connection* connection, PyObject* sql)
8078

8179
if (rc == SQLITE_OK && check_remaining_sql(tail)) {
8280
(void)sqlite3_finalize(self->st);
81+
self->st = NULL;
8382
rc = PYSQLITE_TOO_MUCH_SQL;
8483
}
8584

0 commit comments

Comments
 (0)