diff options
-rw-r--r-- | Modules/_datetimemodule.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c index 2522b65..3ba700b 100644 --- a/Modules/_datetimemodule.c +++ b/Modules/_datetimemodule.c @@ -1290,8 +1290,11 @@ tzinfo_from_isoformat_results(int rv, int tzoffset, int tz_useconds) { } PyObject *delta = new_delta(0, tzoffset, tz_useconds, 1); + if (delta == NULL) { + return NULL; + } tzinfo = new_timezone(delta, NULL); - Py_XDECREF(delta); + Py_DECREF(delta); } else { tzinfo = Py_None; Py_INCREF(Py_None); |