diff --git a/psycopg/adapter_datetime.c b/psycopg/adapter_datetime.c index 0571837d..9d04df40 100644 --- a/psycopg/adapter_datetime.c +++ b/psycopg/adapter_datetime.c @@ -451,7 +451,7 @@ psyco_TimestampFromTicks(PyObject *self, PyObject *args) tz); exit: - Py_DECREF(tz); + Py_XDECREF(tz); Py_XDECREF(m); return res; }