gh-123229: Fix valgrind warning by initializing the f-string buffers to 0 in the tokenizer (GH-123263)
(cherry picked from commit
adc5190014efcf7b7a4c5dfc9998faa8345527ed)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
--- /dev/null
+Fix valgrind warning by initializing the f-string buffers to 0 in the
+tokenizer. Patch by Pablo Galindo
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;