Mercurial > cpython-lru_cache-weakref
diff Modules/_sqlite/connection.c @ 59560:f40a80852480
Merged revisions 78898 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r78898 | victor.stinner | 2010-03-13 04:27:07 +0100 (sam., 13 mars 2010) | 7 lines
sqlite3: Fix a segfault on calling a connection with something else than a
string. Initialize all attributes to be able to call the statement destructor
on error.
Avoid also a duplicate connection in some tests: setUp() does already open a
connection (":memory:").
........
| author | Victor Stinner <victor.stinner@haypocalc.com> |
|---|---|
| date | Sat, 13 Mar 2010 03:28:34 +0000 |
| parents | c21b3e32ed7b |
| children | 3f2773ae8448 |
line wrap: on
line diff
--- a/Modules/_sqlite/connection.c Sat Mar 13 01:28:34 2010 +0000 +++ b/Modules/_sqlite/connection.c Sat Mar 13 03:28:34 2010 +0000 @@ -1125,6 +1125,12 @@ return NULL; } + statement->db = NULL; + statement->st = NULL; + statement->sql = NULL; + statement->in_use = 0; + statement->in_weakreflist = NULL; + rc = pysqlite_statement_create(statement, self, sql); if (rc != SQLITE_OK) {
