From 7668a8bc93c2bd573716d1bea0f52ea520502b28 Mon Sep 17 00:00:00 2001 From: Andy Lester Date: Tue, 24 Mar 2020 23:26:44 -0500 Subject: Use calloc-based functions, not malloc. (GH-19152) --- Python/pystate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Python/pystate.c') diff --git a/Python/pystate.c b/Python/pystate.c index 8f0b6b87d6..bd2e44d7a0 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -206,12 +206,11 @@ PyInterpreterState_New(void) return NULL; } - PyInterpreterState *interp = PyMem_RawMalloc(sizeof(PyInterpreterState)); + PyInterpreterState *interp = PyMem_RawCalloc(1, sizeof(PyInterpreterState)); if (interp == NULL) { return NULL; } - memset(interp, 0, sizeof(*interp)); interp->id_refcount = -1; _PyRuntimeState *runtime = &_PyRuntime; -- cgit v1.2.3