Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in_tail: avoid double free for multiline msgpack buffer #4243

Merged
merged 1 commit into from
Oct 27, 2021

Conversation

hossain-rayhan
Copy link
Contributor

Signed-off-by: Rayhan Hossain hossain.rayhan@outlook.com

We are double freeing &file->mult_sbuf for multiline flush and Fluent Bit is crasing. This happens when we use multiline parser and rotate the file.

The first free is happening at tail_multiline.c:491 and the next free is happening at tail_file.c:1024.

From my investigation, I think we can avoid it in two different ways.

  • Assign NULL after freeing the memory at tail_multiline.c:491 which I am doing in this PR. This way we won't have an issue if tail_file.c tries again to free that NULL assigned memory. I tested and it works.
  • Rmove the double fee from line tail_file.c:1024. I am not sure if it has any other use case. But this will also work and I have tested it.

Fixes #4177
Copy: aws/aws-for-fluent-bit#255

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

Signed-off-by: Rayhan Hossain <hossain.rayhan@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants