Skip to content

Commit 4988453

Browse files
Alexey Izbyshevbenjaminp
authored andcommitted
closes bpo-34471: _datetime: Add missing NULL check to tzinfo_from_isoformat_results. (GH-8869)
Reported by Svace static analyzer.
1 parent 91cb298 commit 4988453

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Modules/_datetimemodule.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1290,8 +1290,11 @@ tzinfo_from_isoformat_results(int rv, int tzoffset, int tz_useconds) {
12901290
}
12911291

12921292
PyObject *delta = new_delta(0, tzoffset, tz_useconds, 1);
1293+
if (delta == NULL) {
1294+
return NULL;
1295+
}
12931296
tzinfo = new_timezone(delta, NULL);
1294-
Py_XDECREF(delta);
1297+
Py_DECREF(delta);
12951298
} else {
12961299
tzinfo = Py_None;
12971300
Py_INCREF(Py_None);

0 commit comments

Comments
 (0)