diff options
author | Gerhard Häring <gh@ghaering.de> | 2008-10-08 08:45:16 +0000 |
---|---|---|
committer | Gerhard Häring <gh@ghaering.de> | 2008-10-08 08:45:16 +0000 |
commit | f80527679b64f9c14c555db6843fac659b1e3aeb (patch) | |
tree | c7c81ea6bbe6781bda91e0c55f7c230779407bd4 /Modules/_sqlite/module.c | |
parent | bab0f2ff662fa5e94115d2e902d3a694d61ad7f9 (diff) | |
download | cpython-git-f80527679b64f9c14c555db6843fac659b1e3aeb.tar.gz |
Issue #4046: Backport of issue #3312's patch: fixes two crashes in the sqlite3
module.
Diffstat (limited to 'Modules/_sqlite/module.c')
-rw-r--r-- | Modules/_sqlite/module.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/_sqlite/module.c b/Modules/_sqlite/module.c index 606454ca1f..bfaf730e0c 100644 --- a/Modules/_sqlite/module.c +++ b/Modules/_sqlite/module.c @@ -128,12 +128,15 @@ static PyObject* module_register_adapter(PyObject* self, PyObject* args, PyObjec { PyTypeObject* type; PyObject* caster; + int rc; if (!PyArg_ParseTuple(args, "OO", &type, &caster)) { return NULL; } - microprotocols_add(type, (PyObject*)&SQLitePrepareProtocolType, caster); + rc = microprotocols_add(type, (PyObject*)&SQLitePrepareProtocolType, caster); + if (rc == -1) + return NULL; Py_INCREF(Py_None); return Py_None; |