Skip to content

RDK-56115 - Fix coverity issues in RRD [High] #103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: develop
Choose a base branch
from
Open
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
17 changes: 13 additions & 4 deletions src/rrdEventProcess.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void processIssueTypeEvent(data_buf *rbuf)
}

RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: ...Exiting...\n", __FUNCTION__, __LINE__);
return;
return; // CID 336987: Resource leak (RESOURCE_LEAK)
}

/*
Expand Down Expand Up @@ -296,13 +296,22 @@ static void processIssueTypeInStaticProfile(data_buf *rbuf, issueNodeData *pIssu
if (isStaticIssue)
{
// Issue in Static Profile JSON
RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "[%s:%d]: Issue Data Node: %s and Sub-Node: %s found in Static JSON File %s... \n", __FUNCTION__, __LINE__, pIssueNode->Node, pIssueNode->subNode, RRD_JSON_FILE);
checkIssueNodeInfo(pIssueNode, jsonParsed, rbuf, false, NULL); // sanity Check and Get Command List
if ( pIssueNode->Node && pIssueNode->subNode ) // CID 336981: Use after free (USE_AFTER_FREE), CID 336980:Use after free (USE_AFTER_FREE)
{
RDK_LOG(RDK_LOG_INFO, LOG_REMDEBUG, "[%s:%d]: Issue Data Node: %s and Sub-Node: %s found in Static JSON File %s... \n", __FUNCTION__, __LINE__, pIssueNode->Node, pIssueNode->subNode, RRD_JSON_FILE);
if( rbuf ) // CID 336984: Double free (USE_AFTER_FREE)
{
checkIssueNodeInfo(pIssueNode, jsonParsed, rbuf, false, NULL); // sanity Check and Get Command List
}
}
}
else
{
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d] Issue Data Not found in Static JSON File... \n", __FUNCTION__, __LINE__);
processIssueTypeInInstalledPackage(rbuf, pIssueNode);
if ( pIssueNode->Node && pIssueNode->subNode ) // CID 336980: Double free (USE_AFTER_FREE), CID 336980:Use after free (USE_AFTER_FREE)
{
processIssueTypeInInstalledPackage(rbuf, pIssueNode);
}
}

freeParsedJson(jsonParsed);
Expand Down
Loading