diff options
author | Pablo Galindo Salgado <Pablogsal@gmail.com> | 2024-08-23 12:33:45 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-23 12:33:45 (GMT) |
commit | adc5190014efcf7b7a4c5dfc9998faa8345527ed (patch) | |
tree | c8eff555bde9efd045a0fba9e632972154b31ba9 /Parser | |
parent | 0b0f7befaddb2b5eff2811398a0f0d4604a82a90 (diff) | |
download | cpython-adc5190014efcf7b7a4c5dfc9998faa8345527ed.zip cpython-adc5190014efcf7b7a4c5dfc9998faa8345527ed.tar.gz cpython-adc5190014efcf7b7a4c5dfc9998faa8345527ed.tar.bz2 |
gh-123229: Fix valgrind warning by initializing the f-string buffers to 0 in the tokenizer (#123263)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Diffstat (limited to 'Parser')
-rw-r--r-- | Parser/lexer/state.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Parser/lexer/state.c b/Parser/lexer/state.c index 647f291..1665deb 100644 --- a/Parser/lexer/state.c +++ b/Parser/lexer/state.c @@ -12,7 +12,8 @@ struct tok_state * _PyTokenizer_tok_new(void) { - struct tok_state *tok = (struct tok_state *)PyMem_Malloc( + struct tok_state *tok = (struct tok_state *)PyMem_Calloc( + 1, sizeof(struct tok_state)); if (tok == NULL) return NULL; |