diff options
author | Erlend E. Aasland <erlend@python.org> | 2024-01-26 10:11:35 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-26 10:11:35 (GMT) |
commit | dcd28b5c35dda8e2cb7c5f66450f2aff0948c001 (patch) | |
tree | 901906c90bedd8d602dcdfd114230b2dd903301c /Modules/_sre | |
parent | d0f7f5c41d71758c59f9372a192e927d73cf7c27 (diff) | |
download | cpython-dcd28b5c35dda8e2cb7c5f66450f2aff0948c001.zip cpython-dcd28b5c35dda8e2cb7c5f66450f2aff0948c001.tar.gz cpython-dcd28b5c35dda8e2cb7c5f66450f2aff0948c001.tar.bz2 |
gh-114569: Use PyMem_* APIs for most non-PyObject uses (#114574)
Fix usage in Modules, Objects, and Parser subdirectories.
Diffstat (limited to 'Modules/_sre')
-rw-r--r-- | Modules/_sre/sre_lib.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_sre/sre_lib.h b/Modules/_sre/sre_lib.h index f5497d9..97fbb0a 100644 --- a/Modules/_sre/sre_lib.h +++ b/Modules/_sre/sre_lib.h @@ -1122,7 +1122,7 @@ dispatch: /* install new repeat context */ /* TODO(https://github.com/python/cpython/issues/67877): Fix this * potential memory leak. */ - ctx->u.rep = (SRE_REPEAT*) PyObject_Malloc(sizeof(*ctx->u.rep)); + ctx->u.rep = (SRE_REPEAT*) PyMem_Malloc(sizeof(*ctx->u.rep)); if (!ctx->u.rep) { PyErr_NoMemory(); RETURN_FAILURE; @@ -1136,7 +1136,7 @@ dispatch: state->ptr = ptr; DO_JUMP(JUMP_REPEAT, jump_repeat, pattern+pattern[0]); state->repeat = ctx->u.rep->prev; - PyObject_Free(ctx->u.rep); + PyMem_Free(ctx->u.rep); if (ret) { RETURN_ON_ERROR(ret); |