Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
bpo-34471: _datetime: Add missing NULL check to tzinfo_from_isoformat…
…_results()

Reported by Svace static analyzer.
  • Loading branch information
Alexey Izbyshev
Alexey Izbyshev committed Aug 23, 2018
commit eca162fa08f9107604501b85230f08748f017d8a
3 changes: 3 additions & 0 deletions Modules/_datetimemodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1290,6 +1290,9 @@ 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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this should be changed to straight Py_DECREF.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, I missed that. Thank you!

} else {
Expand Down