Skip to content

Commit

Permalink
pythongh-123229: Fix valgrind warning by initializing the f-string bu…
Browse files Browse the repository at this point in the history
…ffers to 0 in the tokenizer (python#123263)

Signed-off-by: Pablo Galindo <[email protected]>
  • Loading branch information
pablogsal authored Aug 23, 2024
1 parent 0b0f7be commit adc5190
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix valgrind warning by initializing the f-string buffers to 0 in the
tokenizer. Patch by Pablo Galindo
3 changes: 2 additions & 1 deletion Parser/lexer/state.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit adc5190

Please sign in to comment.