From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Wed, 26 Mar 2025 19:07:51 +0000 (+0100) Subject: [3.13] gh-131762: Fixed dereferencing the pointer 'parser_token->metadata' with a... X-Git-Tag: v3.13.3~77 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b0f387605457c364e29872485a2c9ee74323f3ef;p=thirdparty%2FPython%2Fcpython.git [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> --- 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;