summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorPablo Galindo Salgado <Pablogsal@gmail.com>2024-08-23 12:33:45 (GMT)
committerGitHub <noreply@github.com>2024-08-23 12:33:45 (GMT)
commitadc5190014efcf7b7a4c5dfc9998faa8345527ed (patch)
treec8eff555bde9efd045a0fba9e632972154b31ba9 /Parser
parent0b0f7befaddb2b5eff2811398a0f0d4604a82a90 (diff)
downloadcpython-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.c3
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;