]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-131762: Fixed dereferencing the pointer 'parser_token->metadata' with a...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 26 Mar 2025 19:07:51 +0000 (20:07 +0100)
committerGitHub <noreply@github.com>
Wed, 26 Mar 2025 19:07:51 +0000 (19:07 +0000)
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+rialbat@users.noreply.github.com>
Parser/pegen.c

index 0c3c4689dd7ce6457f7cc32ab1964e1c7a531e72..e0cfc16961987d17496aaadc1ca6b46133918af3 100644 (file)
@@ -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;