diff options
Diffstat (limited to 'PC/getpathp.c')
-rw-r--r-- | PC/getpathp.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/PC/getpathp.c b/PC/getpathp.c index 3b65b35ce6..7a2c1fd6fe 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]; |