]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-131762: Fixed dereferencing the pointer 'parser_token->metadata' with a NULL value...
authorrialbat <47256826+rialbat@users.noreply.github.com>
Wed, 26 Mar 2025 18:44:56 +0000 (21:44 +0300)
committerGitHub <noreply@github.com>
Wed, 26 Mar 2025 18:44:56 +0000 (18:44 +0000)
Parser/pegen.c

index 87a9ba02274d9fed9e06621d4d8b5d4ed214f7c7..592269ead31e397ff0e440c55fdae8db7fe219a2 100644 (file)
@@ -194,7 +194,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;