summaryrefslogtreecommitdiffstats
path: root/PC/winreg.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-07-07 14:21:41 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-07-07 14:21:41 (GMT)
commitb64049183cee61edc112eefa3ca76916d03e9f02 (patch)
treefd0be14ac288739314a5108c6e21879f641b0b40 /PC/winreg.c
parent1a7425f67a0d141483d89ca80ca01e3cb7f6be92 (diff)
downloadcpython-b64049183cee61edc112eefa3ca76916d03e9f02.zip
cpython-b64049183cee61edc112eefa3ca76916d03e9f02.tar.gz
cpython-b64049183cee61edc112eefa3ca76916d03e9f02.tar.bz2
Issue #18203: Replace malloc() with PyMem_Malloc() in Python modules
Replace malloc() with PyMem_Malloc() when the GIL is held, or with PyMem_RawMalloc() otherwise.
Diffstat (limited to 'PC/winreg.c')
-rw-r--r--PC/winreg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/PC/winreg.c b/PC/winreg.c
index a2511d5..79f08a6 100644
--- a/PC/winreg.c
+++ b/PC/winreg.c
@@ -938,7 +938,7 @@ Reg2Py(BYTE *retDataBuf, DWORD retDataSize, DWORD typ)
wchar_t *data = (wchar_t *)retDataBuf;
int len = retDataSize / 2;
int s = countStrings(data, len);
- wchar_t **str = (wchar_t **)malloc(sizeof(wchar_t *)*s);
+ wchar_t **str = (wchar_t **)PyMem_Malloc(sizeof(wchar_t *)*s);
if (str == NULL)
return PyErr_NoMemory();
@@ -959,7 +959,7 @@ Reg2Py(BYTE *retDataBuf, DWORD retDataSize, DWORD typ)
index,
PyUnicode_FromWideChar(str[index], len));
}
- free(str);
+ PyMem_Free(str);
break;
}