From c501b5dce26de4d7b4a7e699aa9ffba4d4254031 Mon Sep 17 00:00:00 2001 From: Hizuru <106918920+Hizuru3@users.noreply.github.com> Date: Wed, 4 Oct 2023 08:42:55 +0900 Subject: [PATCH] Add files via upload --- ext/habachen.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/ext/habachen.c b/ext/habachen.c index 806401d..2e56886 100644 --- a/ext/habachen.c +++ b/ext/habachen.c @@ -919,7 +919,10 @@ Habachen_hira_to_hkata_impl( { /* got ownership: text?, exlist# */ if (ignore) { exlist = PyMem_Calloc(EXLIST_SIZE, 1); - if (!exlist) {goto error;} + if (!exlist) { + PyErr_NoMemory(); + goto error; + } Py_INCREF(ignore); int status = Habachen_build_ignore_list( ignore, exlist, list_filler); @@ -1003,7 +1006,10 @@ Habachen_hira_to_kata_impl( { /* got ownership: text, exlist# */ if (ignore) { exlist = PyMem_Calloc(EXLIST_SIZE, 1); - if (!exlist) {goto error;} + if (!exlist) { + PyErr_NoMemory(); + goto error; + } Py_INCREF(ignore); int status = Habachen_build_ignore_list( ignore, exlist, list_filler); @@ -1108,7 +1114,10 @@ Habachen_kata_to_hira_impl( { /* got ownership: text, exlist# */ if (ignore) { exlist = PyMem_Calloc(EXLIST_SIZE, 1); - if (!exlist) {goto error;} + if (!exlist) { + PyErr_NoMemory(); + goto error; + } Py_INCREF(ignore); int status = Habachen_build_ignore_list( ignore, exlist, list_filler);