Skip to content

Commit

Permalink
Apply review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaloney committed Oct 31, 2024
1 parent f08defa commit e153d97
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions Modules/_io/fileio.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,6 @@ _io_FileIO_close_impl(fileio *self, PyTypeObject *cls)
PyErr_Clear();
}
}
PyMem_Free(self->stat_atopen);
self->stat_atopen = NULL;
rc = internal_close(self);
if (res == NULL) {
_PyErr_ChainExceptions1(exc);
Expand Down Expand Up @@ -270,8 +268,6 @@ _io_FileIO___init___impl(fileio *self, PyObject *nameobj, const char *mode,
assert(PyFileIO_Check(state, self));
#endif
if (self->fd >= 0) {
PyMem_Free(self->stat_atopen);
self->stat_atopen = NULL;
if (self->closefd) {
/* Have to close the existing file first. */
if (internal_close(self) < 0) {
Expand Down Expand Up @@ -462,9 +458,7 @@ _io_FileIO___init___impl(fileio *self, PyObject *nameobj, const char *mode,
#endif
}

if (self->stat_atopen != NULL) {
PyMem_Free(self->stat_atopen);
}
PyMem_Free(self->stat_atopen);
self->stat_atopen = PyMem_New(struct _Py_stat_struct, 1);
if (self->stat_atopen == NULL) {
PyErr_NoMemory();
Expand Down

0 comments on commit e153d97

Please sign in to comment.