This was detected by our Coverity scan as a REVERSE_INULL issue.
Automerge-Triggered-By: @gpshead
--- /dev/null
+Fixed an instance where a MemoryError within the zoneinfo module might not be reported or not reported at its source. (found by Coverity)
\ No newline at end of file
instance =
PyObject_CallMethod(weak_cache, "setdefault", "OO", key, tmp);
- ((PyZoneInfo_ZoneInfo *)instance)->source = SOURCE_CACHE;
-
Py_DECREF(tmp);
-
if (instance == NULL) {
return NULL;
}
+ ((PyZoneInfo_ZoneInfo *)instance)->source = SOURCE_CACHE;
}
update_strong_cache(type, key, instance);
}
*abbr = PyUnicode_FromStringAndSize(str_start, str_end - str_start);
- if (abbr == NULL) {
+ if (*abbr == NULL) {
return -1;
}