Use calloc-based functions, not malloc. (GH-19152)

diff --git a/PC/_testconsole.c b/PC/_testconsole.c
index 23d1286..f6fcfcf 100644
--- a/PC/_testconsole.c
+++ b/PC/_testconsole.c
@@ -55,10 +55,9 @@
     const wchar_t *p = (const wchar_t *)PyBytes_AS_STRING(s);
     DWORD size = (DWORD)PyBytes_GET_SIZE(s) / sizeof(wchar_t);
 
-    rec = (INPUT_RECORD*)PyMem_Malloc(sizeof(INPUT_RECORD) * size);
+    rec = (INPUT_RECORD*)PyMem_Calloc(size, sizeof(INPUT_RECORD));
     if (!rec)
         goto error;
-    memset(rec, 0, sizeof(INPUT_RECORD) * size);
 
     INPUT_RECORD *prec = rec;
     for (DWORD i = 0; i < size; ++i, ++p, ++prec) {
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 @@
     /* 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];