Skip to content

RDKB-64839 Fix memory leaks in bus_insert_elem_node on duplicate elem…#1142

Open
WellPeter wants to merge 1 commit into
rdkcentral:mainfrom
WellPeter:RDKB-64839_main
Open

RDKB-64839 Fix memory leaks in bus_insert_elem_node on duplicate elem…#1142
WellPeter wants to merge 1 commit into
rdkcentral:mainfrom
WellPeter:RDKB-64839_main

Conversation

@WellPeter
Copy link
Copy Markdown
Contributor

…ent insertion

Reason for change: Memory leak in onewifi process
Test Procedure: Debug
Priority: P1
Risks: Low

…ent insertion

Reason for change: Memory leak in onewifi process
Test Procedure: Debug
Priority: P1
Risks: Low

Signed-off-by: Petro Krynytskyi <petr0krynytskiy@gmail.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses a memory leak in bus_insert_elem_node() when inserting an element whose node already exists (duplicate insert), improving stability of the onewifi process.

Changes:

  • Free previously allocated current_node->node_elem_data before overwriting it on re-insert to prevent leaks.
  • Avoid creating a new table row template ({i}) when a table node already has a child, preventing child-node leaks/overwrites on duplicate inserts.
  • Add cleanup for node_elem_data when table row-template allocation fails.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread source/platform/common/bus_common.c
@WellPeter WellPeter marked this pull request as ready for review May 21, 2026 14:42
@WellPeter WellPeter marked this pull request as draft May 22, 2026 12:19
@WellPeter WellPeter marked this pull request as ready for review May 22, 2026 16:18
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.

2 participants