summaryrefslogtreecommitdiff
path: root/Modules/_sqlite/module.c
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-07-16 22:33:18 +0000
committerGeorg Brandl <georg@python.org>2008-07-16 22:33:18 +0000
commita24869ada70ab30f4e08d71cdefda644cc40c6b0 (patch)
tree74fee137cbc427d59b168e931ec8e66ec4671cc0 /Modules/_sqlite/module.c
parent4ed9be733b58712e3e91dafa5ab13cc0a6d99702 (diff)
downloadcpython-git-a24869ada70ab30f4e08d71cdefda644cc40c6b0.tar.gz
#3312: fix two sqlite3 crashes.
Diffstat (limited to 'Modules/_sqlite/module.c')
-rw-r--r--Modules/_sqlite/module.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/_sqlite/module.c b/Modules/_sqlite/module.c
index ceec418b2e..7640e923c8 100644
--- a/Modules/_sqlite/module.c
+++ b/Modules/_sqlite/module.c
@@ -147,6 +147,7 @@ static PyObject* module_register_adapter(PyObject* self, PyObject* args)
{
PyTypeObject* type;
PyObject* caster;
+ int rc;
if (!PyArg_ParseTuple(args, "OO", &type, &caster)) {
return NULL;
@@ -159,7 +160,9 @@ static PyObject* module_register_adapter(PyObject* self, PyObject* args)
pysqlite_BaseTypeAdapted = 1;
}
- microprotocols_add(type, (PyObject*)&pysqlite_PrepareProtocolType, caster);
+ rc = microprotocols_add(type, (PyObject*)&pysqlite_PrepareProtocolType, caster);
+ if (rc == -1)
+ return NULL;
Py_INCREF(Py_None);
return Py_None;