summaryrefslogtreecommitdiffstats
path: root/Modules/_cursesmodule.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 /Modules/_cursesmodule.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 'Modules/_cursesmodule.c')
-rw-r--r--Modules/_cursesmodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
index dff1a17..fbe18f6 100644
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -3406,7 +3406,7 @@ PyInit__curses(void)
continue;
if (strncmp(key_n,"KEY_F(",6)==0) {
char *p1, *p2;
- key_n2 = malloc(strlen(key_n)+1);
+ key_n2 = PyMem_Malloc(strlen(key_n)+1);
if (!key_n2) {
PyErr_NoMemory();
break;
@@ -3425,7 +3425,7 @@ PyInit__curses(void)
key_n2 = key_n;
SetDictInt(key_n2,key);
if (key_n2 != key_n)
- free(key_n2);
+ PyMem_Free(key_n2);
}
#endif
SetDictInt("KEY_MIN", KEY_MIN);