[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 2c686a9ac2)

Co-authored-by: rialbat <47256826+rialbat@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2025-03-26 20:07:51 +01:00 committed by GitHub
parent 9d3f538471
commit b0f3876054
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View 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;