Skip to content

RDKB-63013 native bld test DO NOT MERGE - #12

Closed
Suganya-Sugumar wants to merge 1 commit into
developfrom
feature/test_native_bld_cov
Closed

RDKB-63013 native bld test DO NOT MERGE#12
Suganya-Sugumar wants to merge 1 commit into
developfrom
feature/test_native_bld_cov

Conversation

@Suganya-Sugumar

Copy link
Copy Markdown
Contributor

No description provided.

@Suganya-Sugumar
Suganya-Sugumar requested a review from a team as a code owner February 26, 2026 03:25
Copilot AI review requested due to automatic review settings February 26, 2026 03:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 introduces intentional memory leak code for Coverity testing purposes. The title explicitly states "DO NOT MERGE", indicating this is test code meant to validate static analysis tools rather than production code.

Changes:

  • Added intentional memory leak in the session_start function to test Coverity's detection capabilities

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

Comment thread source/jst_session.c
Comment on lines +80 to +81
test[0] = 'a';
/* intentionally do nothing with leak or free it */

Copilot AI Feb 26, 2026

Copy link

Choose a reason for hiding this comment

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

This code introduces an intentional memory leak that should not be merged into the codebase. The allocated memory is never freed, which will cause a resource leak every time session_start is called. Even though this appears to be test code for Coverity, it should not be included in production code.

Suggested change
test[0] = 'a';
/* intentionally do nothing with leak or free it */
if (test != NULL) {
test[0] = 'a';
free(test);
}

Copilot uses AI. Check for mistakes.
Comment thread source/jst_session.c
Comment on lines +78 to +82
/* ----------- MEMORY LEAK FOR COVERITY TEST ----------- */
char *test = malloc(100); // allocate 100 bytes
test[0] = 'a';
/* intentionally do nothing with leak or free it */
/* --------------------------------------------------------------- */

Copilot AI Feb 26, 2026

Copy link

Choose a reason for hiding this comment

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

The variable 'test' is assigned but never used meaningfully. This dead code serves no functional purpose and should be removed.

Suggested change
/* ----------- MEMORY LEAK FOR COVERITY TEST ----------- */
char *test = malloc(100); // allocate 100 bytes
test[0] = 'a';
/* intentionally do nothing with leak or free it */
/* --------------------------------------------------------------- */

Copilot uses AI. Check for mistakes.
@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

Coverity Issue - Resource leak

Variable "test" going out of scope leaks the storage it points to.

High Impact, CWE-404
RESOURCE_LEAK

Issue location

This issue was discovered outside the diff for this Pull Request. You can find it at:
source/jst_session.c:94

@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

Coverity Issue - Resource leak

Variable "test" going out of scope leaks the storage it points to.

High Impact, CWE-404
RESOURCE_LEAK

Issue location

This issue was discovered outside the diff for this Pull Request. You can find it at:
source/jst_session.c:160

@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

Coverity Issue - Resource leak

Variable "test" going out of scope leaks the storage it points to.

High Impact, CWE-404
RESOURCE_LEAK

Issue location

This issue was discovered outside the diff for this Pull Request. You can find it at:
source/jst_session.c:101

@rdkcmf-jenkins

Copy link
Copy Markdown
Contributor

Coverity Issue - Resource leak

Variable "test" going out of scope leaks the storage it points to.

High Impact, CWE-404
RESOURCE_LEAK

Issue location

This issue was discovered outside the diff for this Pull Request. You can find it at:
source/jst_session.c:157

@github-actions github-actions Bot locked and limited conversation to collaborators Feb 26, 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