aboutsummaryrefslogtreecommitdiff
path: root/Python/pystate.c
diff options
context:
space:
mode:
authorAndy Lester <andy@petdance.com>2020-03-24 23:26:44 -0500
committerGitHub <noreply@github.com>2020-03-24 23:26:44 -0500
commit7668a8bc93c2bd573716d1bea0f52ea520502b28 (patch)
tree0c6dce63a06466c3f9136df09f5cd928d20e5c55 /Python/pystate.c
parent7dd549eb08939e1927fba818116f5202e76f8d73 (diff)
downloadcpython3-7668a8bc93c2bd573716d1bea0f52ea520502b28.tar.gz
Use calloc-based functions, not malloc. (GH-19152)
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c3
1 files changed, 1 insertions, 2 deletions
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;