From c6842903927385dc317544d0521b89d81724279b Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith" Date: Mon, 22 May 2023 19:08:11 -0700 Subject: [PATCH] Don't use Raw malloc & free. Backport of d1732feea0eadd4ccc3516440d0c071be0093dec to 3.11 from #104697. --- Modules/_posixsubprocess.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/_posixsubprocess.c b/Modules/_posixsubprocess.c index 61c9bec8a60c54..fb2f28fdeaa4e2 100644 --- a/Modules/_posixsubprocess.c +++ b/Modules/_posixsubprocess.c @@ -1026,7 +1026,7 @@ subprocess_fork_exec(PyObject *module, PyObject *args) #endif /* HAVE_SETREUID */ } - c_fds_to_keep = PyMem_RawMalloc(fds_to_keep_len * sizeof(int)); + c_fds_to_keep = PyMem_Malloc(fds_to_keep_len * sizeof(int)); if (c_fds_to_keep == NULL) { PyErr_SetString(PyExc_MemoryError, "failed to malloc c_fds_to_keep"); goto cleanup; @@ -1109,7 +1109,7 @@ subprocess_fork_exec(PyObject *module, PyObject *args) cleanup: if (c_fds_to_keep != NULL) { - PyMem_RawFree(c_fds_to_keep); + PyMem_Free(c_fds_to_keep); } if (saved_errno != 0) {