Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion Modules/_tracemalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,7 @@ tracemalloc_copy_trace(_Py_hashtable_t *traces,
trace_t *trace = (trace_t *)value;

trace_t *trace2 = raw_malloc(sizeof(trace_t));
if (traces2 == NULL) {
if (trace2 == NULL) {
return -1;
}
*trace2 = *trace;
Expand Down
12 changes: 12 additions & 0 deletions Modules/_zoneinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,13 @@ load_data(PyZoneInfo_ZoneInfo *self, PyObject *file_obj)
// Load the transition indices and list
self->trans_list_utc =
PyMem_Malloc(self->num_transitions * sizeof(int64_t));
if (self->trans_list_utc == NULL) {
goto error;
}
trans_idx = PyMem_Malloc(self->num_transitions * sizeof(Py_ssize_t));
if (trans_idx == NULL) {
goto error;
}

for (size_t i = 0; i < self->num_transitions; ++i) {
PyObject *num = PyTuple_GetItem(trans_utc, i);
Expand Down Expand Up @@ -989,6 +995,9 @@ load_data(PyZoneInfo_ZoneInfo *self, PyObject *file_obj)

// Build _ttinfo objects from utcoff, dstoff and abbr
self->_ttinfos = PyMem_Malloc(self->num_ttinfos * sizeof(_ttinfo));
if (self->_ttinfos == NULL) {
goto error;
}
for (size_t i = 0; i < self->num_ttinfos; ++i) {
PyObject *tzname = PyTuple_GetItem(abbr, i);
if (tzname == NULL) {
Expand All @@ -1004,6 +1013,9 @@ load_data(PyZoneInfo_ZoneInfo *self, PyObject *file_obj)
// Build our mapping from transition to the ttinfo that applies
self->trans_ttinfos =
PyMem_Calloc(self->num_transitions, sizeof(_ttinfo *));
if (self->trans_ttinfos == NULL) {
goto error;
}
for (size_t i = 0; i < self->num_transitions; ++i) {
size_t ttinfo_idx = trans_idx[i];
assert(ttinfo_idx < self->num_ttinfos);
Expand Down