Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6c09192

Browse files
committed
gh-123229: Fix valgrind warning by initializing the f-string buffers to 0 in the tokenizer
1 parent 0b0f7be commit 6c09192

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Parser/lexer/state.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
struct tok_state *
1313
_PyTokenizer_tok_new(void)
1414
{
15-
struct tok_state *tok = (struct tok_state *)PyMem_Malloc(
15+
struct tok_state *tok = (struct tok_state *)PyMem_Calloc(
16+
1,
1617
sizeof(struct tok_state));
1718
if (tok == NULL)
1819
return NULL;

0 commit comments

Comments
 (0)