From 8c23031f10a329ca80082c30bbf50d07030ee3e7 Mon Sep 17 00:00:00 2001 From: Richard Barnes Date: Fri, 19 Jul 2024 13:49:16 -0700 Subject: [PATCH] Update tok_parse.c --- src/mwparserfromhell/parser/ctokenizer/tok_parse.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mwparserfromhell/parser/ctokenizer/tok_parse.c b/src/mwparserfromhell/parser/ctokenizer/tok_parse.c index 5cb470d..d3e83ef 100644 --- a/src/mwparserfromhell/parser/ctokenizer/tok_parse.c +++ b/src/mwparserfromhell/parser/ctokenizer/tok_parse.c @@ -1557,10 +1557,11 @@ Tokenizer_handle_tag_close_close(Tokenizer *self) } Py_XDECREF(so); Py_XDECREF(sc); + // One of `so` or `sc` failed to allocate so we clean up the + // closing tag and propagate the error by returning NULL. + Py_DECREF(closing); + return NULL; } - // One of `so` or `sc` failed to allocate so we fall through to clean up the - // closing tag and propagate the error by returning NULL. - __attribute__((fallthrough)); case -1: Py_DECREF(closing); return NULL;