From 6c09192e905eafa1d714f0df292239b46e097fc5 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Date: Fri, 23 Aug 2024 13:07:40 +0100 Subject: [PATCH] gh-123229: Fix valgrind warning by initializing the f-string buffers to 0 in the tokenizer --- Parser/lexer/state.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Parser/lexer/state.c b/Parser/lexer/state.c index 647f291911564c4..1665debea30b301 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;