summaryrefslogtreecommitdiffstats
path: root/PC/getpathp.c
diff options
context:
space:
mode:
authorAndy Lester <andy@petdance.com>2020-03-25 04:26:44 (GMT)
committerGitHub <noreply@github.com>2020-03-25 04:26:44 (GMT)
commit7668a8bc93c2bd573716d1bea0f52ea520502b28 (patch)
tree0c6dce63a06466c3f9136df09f5cd928d20e5c55 /PC/getpathp.c
parent7dd549eb08939e1927fba818116f5202e76f8d73 (diff)
downloadcpython-7668a8bc93c2bd573716d1bea0f52ea520502b28.zip
cpython-7668a8bc93c2bd573716d1bea0f52ea520502b28.tar.gz
cpython-7668a8bc93c2bd573716d1bea0f52ea520502b28.tar.bz2
Use calloc-based functions, not malloc. (GH-19152)
Diffstat (limited to 'PC/getpathp.c')
-rw-r--r--PC/getpathp.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/PC/getpathp.c b/PC/getpathp.c
index 3b65b35..7a2c1fd 100644
--- a/PC/getpathp.c
+++ b/PC/getpathp.c
@@ -370,11 +370,10 @@ getpythonregpath(HKEY keyBase, int skipcore)
/* Allocate a temp array of char buffers, so we only need to loop
reading the registry once
*/
- ppPaths = PyMem_RawMalloc( sizeof(WCHAR *) * numKeys );
+ ppPaths = PyMem_RawCalloc(numKeys, sizeof(WCHAR *));
if (ppPaths==NULL) {
goto done;
}
- memset(ppPaths, 0, sizeof(WCHAR *) * numKeys);
/* Loop over all subkeys, allocating a temp sub-buffer. */
for(index=0;index<numKeys;index++) {
WCHAR keyBuf[MAX_PATH+1];