summaryrefslogtreecommitdiffstats
path: root/Modules/_sqlite
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-03-21 20:29:20 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-03-21 20:29:20 (GMT)
commit09e4697ad1c759138aa4c576b97120775e90313b (patch)
tree21139e6b70f9e453e5e4ba1be39529f8be96d178 /Modules/_sqlite
parent8a685f7184c543bf8515ffcc2597246c0149fbca (diff)
downloadcpython-09e4697ad1c759138aa4c576b97120775e90313b.zip
cpython-09e4697ad1c759138aa4c576b97120775e90313b.tar.gz
cpython-09e4697ad1c759138aa4c576b97120775e90313b.tar.bz2
Merged revisions 78899 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r78899 | victor.stinner | 2010-03-13 04:28:34 +0100 (sam., 13 mars 2010) | 14 lines 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/_sqlite')
-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 08588bc..4b8088d 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -979,6 +979,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) {