Skip to content

Fix leak in blockRouterAdvertisements#5476

Merged
willmmiles merged 1 commit intowled:mainfrom
willmmiles:ipv6-filter-oops
Apr 5, 2026
Merged

Fix leak in blockRouterAdvertisements#5476
willmmiles merged 1 commit intowled:mainfrom
willmmiles:ipv6-filter-oops

Conversation

@willmmiles
Copy link
Copy Markdown
Member

@willmmiles willmmiles commented Apr 4, 2026

Fix memory leak introduced by #5438

Summary by CodeRabbit

  • Bug Fixes
    • Fixed a memory leak in network packet handling operations, improving system stability.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: fb22e059-1581-4656-b6db-de717aa66482

📥 Commits

Reviewing files that changed from the base of the PR and between 51862e3 and 0ef5ee7.

📒 Files selected for processing (1)
  • wled00/network.cpp

Walkthrough

Added explicit packet buffer deallocation in the ICMPv6 Router Advertisement blocking callback function. The function now frees the incoming pbuf before returning 1 to claim the packet, ensuring proper memory management instead of leaving buffer cleanup to lwIP's subsequent handling.

Changes

Cohort / File(s) Summary
Memory management in IPv6 RA blocking
wled00/network.cpp
Added pbuf_free(p); in blockRouterAdvertisements() to explicitly release packet buffers when ICMPv6 Router Advertisements are detected, preventing potential memory leaks.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • Fix DNS hangs on ESP32 #5438: Adds the foundational IPv6 Router Advertisement blocking logic that this PR improves with explicit memory management.

Suggested reviewers

  • DedeHai
  • softhack007
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix leak in blockRouterAdvertisements' accurately summarizes the main change: fixing a memory leak in the blockRouterAdvertisements function by adding pbuf_free().
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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.

@BobLoeffler68
Copy link
Copy Markdown
Contributor

This does fix the bug. Approved. :-)

@willmmiles willmmiles merged commit c819814 into wled:main Apr 5, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants