Skip to content

out_stackdriver: fix multiple memory leaks and potential corruption [Backport to 4.2]#11916

Merged
cosmo0920 merged 1 commit into
fluent:4.2from
baizhenyu:backport/stackdriver-leak-to-4.2
Jun 5, 2026
Merged

out_stackdriver: fix multiple memory leaks and potential corruption [Backport to 4.2]#11916
cosmo0920 merged 1 commit into
fluent:4.2from
baizhenyu:backport/stackdriver-leak-to-4.2

Conversation

@baizhenyu

@baizhenyu baizhenyu commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Backporting #11879


Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • Example configuration file for the change
  • Debug log output from testing the change
  • Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • Run local packaging test showing all targets (including any new ones) build.
  • Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • Documentation required for this feature

Backporting

  • Backport to latest stable release.

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.

- Update fetch_metadata to use flb_sds_t * to handle sds reallocation correctly

- Use temporary variable in fetch_metadata to avoid leaking original SDS on failure

- Fix error handling in fetch_metadata when flb_sds_copy fails

- Fix memory leaks in stackdriver.c by destroying rval and http_request in failure paths

- Fix memory leak in stackdriver_conf.c by destroying project_id before overwriting it

Signed-off-by: Tim Bai <timbai@google.com>
(cherry picked from commit 2da48de)
@baizhenyu baizhenyu requested a review from braydonk as a code owner June 4, 2026 18:30
@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cbaa3336-6748-4034-8f5e-d3ebccc350e9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@braydonk

braydonk commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

I am unable to assign @JeffLuoo for some reason.

@cosmo0920 cosmo0920 merged commit 97948d6 into fluent:4.2 Jun 5, 2026
26 checks passed
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.

4 participants