[Python-checkins] closes bpo-34471: _datetime: Add missing NULL check to tzinfo_from_isoformat_results. (GH-8869)
Benjamin Peterson
webhook-mailer at python.org
Fri Aug 24 11:53:23 EDT 2018
https://github.com/python/cpython/commit/498845368ff0f6238750ab1d443e7cf4ec98ccd2
commit: 498845368ff0f6238750ab1d443e7cf4ec98ccd2
branch: master
author: Alexey Izbyshev <izbyshev at ispras.ru>
committer: Benjamin Peterson <benjamin at python.org>
date: 2018-08-24T08:53:16-07:00
summary:
closes bpo-34471: _datetime: Add missing NULL check to tzinfo_from_isoformat_results. (GH-8869)
Reported by Svace static analyzer.
files:
M Modules/_datetimemodule.c
diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c
index 2522b65f1168..3ba700bbf852 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);
More information about the Python-checkins
mailing list