Skip to content

RDKB-64639 Fix resource leaks in cci process#24

Merged
gsathish86 merged 1 commit into
rdkcentral:developfrom
pavithrasundaravadivel:DEV_fd_leak_cci
May 4, 2026
Merged

RDKB-64639 Fix resource leaks in cci process#24
gsathish86 merged 1 commit into
rdkcentral:developfrom
pavithrasundaravadivel:DEV_fd_leak_cci

Conversation

@pavithrasundaravadivel
Copy link
Copy Markdown
Contributor

@pavithrasundaravadivel pavithrasundaravadivel commented May 4, 2026

Impacted Platforms:
TCXB7, TCXB8

Reason for change: Properly close the FD's before return

Test Procedure: Run any cci test and check for the FD count before/after test

Risks: None

Priority: P1

Signed-off-by:Pavithra_Sundaravadivel@comcast.com

Copy link
Copy Markdown

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 file descriptor/resource leaks in the CCI test execution paths by ensuring opened pipes/files and libpcap dump handles are properly closed on early returns and after use.

Changes:

  • Close the gateway performance result file before aborting on unsupported TopCmdOptions.
  • Add missing pclose()/fclose() calls on error paths in the command test step to prevent leaked pipes/files.
  • Close libpcap dump handles (pcap_dump_close) after writing/flush in both internal and external-agent pcap creation flows.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/tests/wlan_emu_test_param_gateway_performance.cpp Closes the opened result FILE* before returning on invalid command option.
src/tests/wlan_emu_test_param_command.cpp Ensures popen() pipes and optional capture files are closed on additional error paths.
src/messages/wlan_emu_msg.cpp Adds pcap_dump_close() to release the dumper handle after writing the pcap.
src/external_agent_cci/wlan_ext_emu_test_step_params.cpp Adds pcap_dump_close() to release the dumper handle after writing the pcap.

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

@gsathish86 gsathish86 merged commit 91e1651 into rdkcentral:develop May 4, 2026
7 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants