mirror of
https://github.com/python/cpython.git
synced 2025-10-18 04:38:07 +00:00
Use calloc-based functions, not malloc. (GH-19152)
This commit is contained in:
parent
7dd549eb08
commit
7668a8bc93
10 changed files with 17 additions and 38 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue