Skip to content

Commit

Permalink
pack: fix heap-double-free in flb_pack_state_reset (fluent#5883)
Browse files Browse the repository at this point in the history
  • Loading branch information
sashashura authored Aug 20, 2022
1 parent 676a26b commit 74a21b1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/flb_pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,11 +333,13 @@ int flb_pack_state_init(struct flb_pack_state *s)
void flb_pack_state_reset(struct flb_pack_state *s)
{
flb_free(s->tokens);
s->tokens = NULL;
s->tokens_size = 0;
s->tokens_count = 0;
s->last_byte = 0;
s->buf_size = 0;
flb_free(s->buf_data);
s->buf_data = NULL;
}


Expand Down

0 comments on commit 74a21b1

Please sign in to comment.