Skip to content

Commit

Permalink
closes bpo-34471: _datetime: Add missing NULL check to tzinfo_from_is…
Browse files Browse the repository at this point in the history
…oformat_results. (GH-8869)

Reported by Svace static analyzer.
  • Loading branch information
izbyshev authored and benjaminp committed Aug 24, 2018
1 parent 91cb298 commit 4988453
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Modules/_datetimemodule.c
Expand Up @@ -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);
Expand Down

0 comments on commit 4988453

Please sign in to comment.