summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-03-13 03:28:34 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-03-13 03:28:34 (GMT)
commit0201f443f6ec06c468b044d5c2426df520e73dfa (patch)
tree09f7d157484cef00f4ff23d2717bec3d96bcaf30 /Modules
parent5e0110e0c8e5cd5fc6d9571c2def0e6956767107 (diff)
downloadcpython-0201f443f6ec06c468b044d5c2426df520e73dfa.zip
cpython-0201f443f6ec06c468b044d5c2426df520e73dfa.tar.gz
cpython-0201f443f6ec06c468b044d5c2426df520e73dfa.tar.bz2
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:"). ........
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_sqlite/connection.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index 2ce27f5..d916c34 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -1125,6 +1125,12 @@ PyObject* pysqlite_connection_call(pysqlite_Connection* self, PyObject* args, Py
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) {