diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-07-07 14:21:41 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-07-07 14:21:41 (GMT) |
commit | b64049183cee61edc112eefa3ca76916d03e9f02 (patch) | |
tree | fd0be14ac288739314a5108c6e21879f641b0b40 /Modules/_curses_panel.c | |
parent | 1a7425f67a0d141483d89ca80ca01e3cb7f6be92 (diff) | |
download | cpython-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/_curses_panel.c')
-rw-r--r-- | Modules/_curses_panel.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_curses_panel.c b/Modules/_curses_panel.c index f560702..3e9fffd 100644 --- a/Modules/_curses_panel.c +++ b/Modules/_curses_panel.c @@ -117,7 +117,7 @@ insert_lop(PyCursesPanelObject *po) { list_of_panels *new; - if ((new = (list_of_panels *)malloc(sizeof(list_of_panels))) == NULL) { + if ((new = (list_of_panels *)PyMem_Malloc(sizeof(list_of_panels))) == NULL) { PyErr_NoMemory(); return -1; } @@ -136,7 +136,7 @@ remove_lop(PyCursesPanelObject *po) temp = lop; if (temp->po == po) { lop = temp->next; - free(temp); + PyMem_Free(temp); return; } while (temp->next == NULL || temp->next->po != po) { @@ -148,7 +148,7 @@ remove_lop(PyCursesPanelObject *po) temp = temp->next; } n = temp->next->next; - free(temp->next); + PyMem_Free(temp->next); temp->next = n; return; } |