diff Modules/_sqlite/module.c @ 47991:091df4c08d99 legacy-trunk

#3312: fix two sqlite3 crashes.
author Georg Brandl <georg@python.org>
date Wed, 16 Jul 2008 22:33:18 +0000
parents 7b51ea8cc558
children 4c77d1016f60
line wrap: on
line diff
--- a/Modules/_sqlite/module.c	Wed Jul 16 22:09:17 2008 +0000
+++ b/Modules/_sqlite/module.c	Wed Jul 16 22:33:18 2008 +0000
@@ -147,6 +147,7 @@
 {
     PyTypeObject* type;
     PyObject* caster;
+    int rc;
 
     if (!PyArg_ParseTuple(args, "OO", &type, &caster)) {
         return NULL;
@@ -159,7 +160,9 @@
         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;