mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-26 10:53:44 +03:00
Fixed wrong refcnt on None.
This commit is contained in:
parent
35c42310ec
commit
e1e0b34343
|
@ -1,3 +1,8 @@
|
|||
2005-05-15 Federico Di Gregorio <fog@debian.org>
|
||||
|
||||
* psycopg/microprotocols.c (microprotocols_adapt): fixed memory
|
||||
leak on None as suggested by gh (bug #16.)
|
||||
|
||||
2005-05-10 Federico Di Gregorio <fog@debian.org>
|
||||
|
||||
* lib/extras.py (DictRow): we now save a reference to the index
|
||||
|
|
|
@ -93,6 +93,7 @@ microprotocols_adapt(PyObject *obj, PyObject *proto, PyObject *alt)
|
|||
if (PyObject_HasAttrString(proto, "__adapt__")) {
|
||||
PyObject *adapted = PyObject_CallMethod(proto, "__adapt__", "O", obj);
|
||||
if (adapted && adapted != Py_None) return adapted;
|
||||
Py_XDECREF(adapted);
|
||||
if (PyErr_Occurred() && !PyErr_ExceptionMatches(PyExc_TypeError))
|
||||
return NULL;
|
||||
}
|
||||
|
@ -101,6 +102,7 @@ microprotocols_adapt(PyObject *obj, PyObject *proto, PyObject *alt)
|
|||
if (PyObject_HasAttrString(obj, "__conform__")) {
|
||||
PyObject *adapted = PyObject_CallMethod(obj, "__conform__","O", proto);
|
||||
if (adapted && adapted != Py_None) return adapted;
|
||||
Py_XDECREF(adapted);
|
||||
if (PyErr_Occurred() && !PyErr_ExceptionMatches(PyExc_TypeError))
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user