From b0f387605457c364e29872485a2c9ee74323f3ef Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Wed, 26 Mar 2025 20:07:51 +0100 Subject: [PATCH] [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+rialbat@users.noreply.github.com> --- Parser/pegen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Parser/pegen.c b/Parser/pegen.c index 0c3c4689dd7c..e0cfc1696198 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; -- 2.47.3