https://github.com/python/cpython/commit/66042e180b1de4d4797d3ba16cf9b2fc53de18d1
commit: 66042e180b1de4d4797d3ba16cf9b2fc53de18d1
branch: 3.12
author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com>
committer: pablogsal <pablog...@gmail.com>
date: 2025-03-26T19:01:36Z
summary:

[3.12] gh-131762: Fixed dereferencing the pointer 'parser_token->metadata' with 
a NULL value (GH-131764) (#131775)

gh-131762: Fixed dereferencing the pointer 'parser_token->metadata' with a NULL 
value (GH-131764)
(cherry picked from commit 2c686a9ac243800b630d4a09622c8eb789f5b354)

Co-authored-by: rialbat <47256826+rial...@users.noreply.github.com>

files:
M Parser/pegen.c

diff --git a/Parser/pegen.c b/Parser/pegen.c
index 6ae9bef2160d07..5b92133d9f905b 100644
--- a/Parser/pegen.c
+++ b/Parser/pegen.c
@@ -244,7 +244,7 @@ initialize_token(Parser *p, Token *parser_token, struct 
token *new_token, int to
     parser_token->metadata = NULL;
     if (new_token->metadata != NULL) {
         if (_PyArena_AddPyObject(p->arena, new_token->metadata) < 0) {
-            Py_DECREF(parser_token->metadata);
+            Py_DECREF(new_token->metadata);
             return -1;
         }
         parser_token->metadata = new_token->metadata;

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: arch...@mail-archive.com

Reply via email to