Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions source/jst_session.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
If not stated otherwise in this file or this component's Licenses.txt file the

Check failure on line 2 in source/jst_session.c

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'source/jst_session.c' (Match: rdk/components/generic/jst/rdk/components/generic/jst/2101, 460 lines, url: https://code.rdkcentral.com/r/plugins/gitiles/rdk/components/generic/jst/+archive/rdk-dev-2101.tar.gz, file: source/jst_session.c)
following copyright and licenses apply:

Copyright 2018 RDK Management
Expand Down Expand Up @@ -75,6 +75,12 @@
{
CosaPhpExtLog("%s: entered\n", __PRETTY_FUNCTION__);
const char* cookie;
/* ----------- MEMORY LEAK FOR COVERITY TEST ----------- */
char *test = malloc(100); // allocate 100 bytes
test[0] = 'a';
/* intentionally do nothing with leak or free it */
Comment on lines +80 to +81

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 on lines +78 to +82

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.

/* if session already created then do nothing */
if(session_identifier)
{
Expand Down
Loading