From e153d97899b9e94110ed5f16c4b02ee3f72a5822 Mon Sep 17 00:00:00 2001 From: Cody Maloney Date: Wed, 30 Oct 2024 20:11:43 -0700 Subject: [PATCH] Apply review fixes --- Modules/_io/fileio.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c index 1bdb1770fb5ddd..cf0f1d671b507a 100644 --- a/Modules/_io/fileio.c +++ b/Modules/_io/fileio.c @@ -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); @@ -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) { @@ -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();