mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
[3.12] gh-131762: Fixed dereferencing the pointer 'parser_token->metadata' with a NULL value (GH-131764) (#131775)
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:
parent
1826347d9d
commit
66042e180b
1 changed files with 1 additions and 1 deletions
|
@ -244,7 +244,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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue