From 5ce00f8e5baa79548122b438c8f4d9f92eec682a Mon Sep 17 00:00:00 2001 From: Gabriel Kihlman Date: Mon, 18 Apr 2016 17:28:50 +0200 Subject: [PATCH] Avoid a possible null deref, tz might be NULL. Found by clang static analyzer. --- psycopg/adapter_datetime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }