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

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

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 0c3c4689dd7ce6..e0cfc16961987d 100644
--- a/Parser/pegen.c
+++ b/Parser/pegen.c
@@ -191,7 +191,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