-
Notifications
You must be signed in to change notification settings - Fork 1.8k
in_forward: fix username parsing #11026
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
Conversation
Fix parsing of username from the config value and ensure consistent error handling. Signed-off-by: Eduardo Silva <[email protected]>
WalkthroughAdjusts setup_users in plugins/in_forward/fw.c: changes username length handling, adds proper cleanup of allocated username on password allocation failure, and moves split release to occur only after both allocations succeed, aligning error paths with resource management order. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Caller
participant setup_users
participant Alloc as Allocator
participant Split as SplitCtx
Caller->>setup_users: setup_users(split)
setup_users->>Split: parse sentry
setup_users->>Alloc: allocate username (len = sentry.len)
alt username alloc fails
setup_users-->>Caller: return error (no allocations to free)
else username ok
setup_users->>Alloc: allocate password
alt password alloc fails
setup_users->>Alloc: destroy username
setup_users-->>Caller: return error (split not released here)
else password ok
setup_users->>Split: release split (after both allocations)
setup_users-->>Caller: return success
end
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧬 Code graph analysis (1)plugins/in_forward/fw.c (3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (30)
🔇 Additional comments (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Windows CI issue not related. |
Fix parsing of username from the config value and ensure consistent error handling.
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.
Summary by CodeRabbit
Bug Fixes
Refactor