#3312: fix two sqlite3 crashes.

This commit is contained in:
Georg Brandl 2008-07-16 22:33:18 +00:00
parent 4ed9be733b
commit a24869ada7
4 changed files with 29 additions and 3 deletions

View file

@ -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;