Skip to content

out_azure_blob: fixed double free#10235

Merged
edsiper merged 1 commit intomasterfrom
leonardo-master-issue-9677-fix
Apr 22, 2025
Merged

out_azure_blob: fixed double free#10235
edsiper merged 1 commit intomasterfrom
leonardo-master-issue-9677-fix

Conversation

@leonardo-albertovich
Copy link
Contributor

This PR fixes a double free in send_blob.

Signed-off-by: Leonardo Alminana <leonardo.alminana@chronosphere.io>
/* For Logs type, we need to commit the block right away */
if (event_type == FLB_EVENT_TYPE_LOGS) {
ret = azb_block_blob_commit_block(ctx, block_id, tag, ms);
flb_free(block_id);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it possible, that only removing this line should be enough? Calling flb_free on NULL should not be a problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just removing that line fixes the double free but considering that there are code paths that lead to calling free with block_id holding NULL it's worth adding the check since older systems (and maybe alternative libc implementations?) don't handle it gracefully.

@edsiper edsiper merged commit 67ad458 into master Apr 22, 2025
46 of 48 checks passed
@edsiper edsiper added this to the Fluent Bit v4.0.1 milestone Apr 22, 2025
@edsiper edsiper deleted the leonardo-master-issue-9677-fix branch April 22, 2025 14:34
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.

3 participants

Comments