Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
cd795e2
Refactor issueTypeSplitter to include suffix handling
Abhinavpv28 Apr 30, 2026
a950f13
Update rrdEventProcess.c
Abhinavpv28 Apr 30, 2026
ba3c8ca
Update rrdExecuteScript.c
Abhinavpv28 Apr 30, 2026
63bc161
Refactor rrdEventProcess.h to rrdExecuteScript.h
Abhinavpv28 Apr 30, 2026
c883bd2
Update rrdExecuteScript.h
Abhinavpv28 Apr 30, 2026
9380442
Update rrdExecuteScript.h
Abhinavpv28 Apr 30, 2026
61a9e2c
Update rrdEventProcess.h
Abhinavpv28 Apr 30, 2026
d672210
Update rrdExecuteScript.h
Abhinavpv28 Apr 30, 2026
65d30d0
Update rrdJsonParser.c
Abhinavpv28 Apr 30, 2026
93df789
Update rrdJsonParser.h
Abhinavpv28 Apr 30, 2026
6d37d71
Update rrdInterface.c
Abhinavpv28 Apr 30, 2026
c7588d3
Update rrdCommon.h
Abhinavpv28 Apr 30, 2026
d1345ab
Update rrdEventProcess.c
Abhinavpv28 Apr 30, 2026
e720479
Update rrdEventProcess.c
Abhinavpv28 May 1, 2026
faacd2a
Update rrdEventProcess.c
Abhinavpv28 May 1, 2026
7daeac3
Update rrdEventProcess.c
Abhinavpv28 May 1, 2026
52539a3
Fix indentation for appendMode assignment
Abhinavpv28 May 1, 2026
ec1680e
Update rrdCommon.h
Abhinavpv28 May 1, 2026
bfb7f1e
Fix appendMode assignment in rrdEventProcess.c
Abhinavpv28 May 1, 2026
e71f82e
Update rrdEventProcess.c
Abhinavpv28 May 1, 2026
72b9562
Update rrdJsonParser.c
Abhinavpv28 May 1, 2026
e6b8690
Update rrdEventProcess.c
Abhinavpv28 May 1, 2026
79f6e64
Update rrdExecuteScript.h
Abhinavpv28 May 1, 2026
bd49f43
Update rrdExecuteScript.c
Abhinavpv28 May 1, 2026
3a5f988
Update rrdExecuteScript.c
Abhinavpv28 May 1, 2026
4587984
Update rrdExecuteScript.c
Abhinavpv28 May 1, 2026
5c3f460
Remove redundant logging from rrdJsonParser
Abhinavpv28 May 1, 2026
3d77c29
Update rrdJsonParser.c
Abhinavpv28 May 1, 2026
b5f062b
Update rrdEventProcess.c
Abhinavpv28 May 1, 2026
f21ad0f
Update rrdJsonParser.c
Abhinavpv28 May 1, 2026
02a0507
Update rrdEventProcess.c
Abhinavpv28 May 1, 2026
f509d0a
Update rrdJsonParser.c
Abhinavpv28 May 1, 2026
d10faa4
Apply suggestions from code review
Abhinavpv28 May 1, 2026
5835261
Update rrdEventProcess.c
Abhinavpv28 May 1, 2026
c9dfede
Apply suggestion from @Copilot
Abhinavpv28 May 1, 2026
3c19ac2
Update rrdJsonParser.c
Abhinavpv28 May 1, 2026
3084d70
Fix heap overflow in issueTypeSplitter and memory leaks in suffix han…
Copilot May 2, 2026
eca3fb2
Update rrdUnitTestRunner.cpp
Abhinavpv28 May 2, 2026
2cca47b
Delete .gitignore
Abhinavpv28 May 2, 2026
f44f131
Potential fix for pull request finding
Abhinavpv28 May 2, 2026
9a6cf0d
Update rrdEventProcess.c
Abhinavpv28 May 2, 2026
ae506f9
Update rrdEventProcess.c
Abhinavpv28 May 2, 2026
2e8a039
Update rrdEventProcess.c
Abhinavpv28 May 2, 2026
36587ee
Update rrdEventProcess.c
Abhinavpv28 May 2, 2026
acacbdb
Update rrdUnitTestRunner.cpp
Abhinavpv28 May 2, 2026
5fb10ce
Update rrdEventProcess.c
Abhinavpv28 May 3, 2026
6e21ca0
Update rrdUnitTestRunner.cpp
Abhinavpv28 May 3, 2026
8105959
Update rrdUnitTestRunner.cpp
Abhinavpv28 May 3, 2026
a87a726
Add gtest test cases for split_issue_type
Copilot May 3, 2026
617edf9
Remove build artifacts, add .gitignore
Copilot May 3, 2026
05e0cf8
Add explicit truncated content assertion in SuffixTruncatedWhenTooSma…
Copilot May 3, 2026
3a0687a
Apply suggestions from code review
Abhinavpv28 May 3, 2026
842577e
Update rrdEventProcess.c
Abhinavpv28 May 3, 2026
3b6ffba
Update rrdEventProcess.c
Abhinavpv28 May 3, 2026
638a63e
Update rrdEventProcess.c
Abhinavpv28 May 3, 2026
a889589
Update rrdEventProcess.c
Abhinavpv28 May 3, 2026
f78c999
Update rrdEventProcess.c
Abhinavpv28 May 3, 2026
8405fb2
Update rrdEventProcess.c
Abhinavpv28 May 3, 2026
0038f01
Update rrdEventProcess.c
Abhinavpv28 May 3, 2026
b445c8a
Update rrdEventProcess.c
Abhinavpv28 May 3, 2026
64dc355
Update rrdEventProcess.c
Abhinavpv28 May 3, 2026
0d9850a
Update rrdEventProcess.c
Abhinavpv28 May 3, 2026
ca8c14c
Update rrdEventProcess.c
Abhinavpv28 May 3, 2026
4cb74db
Update rrdEventProcess.c
Abhinavpv28 May 3, 2026
5bf24f2
Potential fix for pull request finding
Abhinavpv28 May 3, 2026
a44c0e8
Update rrdJsonParser.c
Abhinavpv28 May 3, 2026
3a798ef
Update rrdJsonParser.c
Abhinavpv28 May 3, 2026
c350bb0
Potential fix for pull request finding
Abhinavpv28 May 3, 2026
cf3a830
Potential fix for pull request finding
Abhinavpv28 May 3, 2026
1bc5ed3
Potential fix for pull request finding
Abhinavpv28 May 3, 2026
7d1e5ad
Update rrdUnitTestRunner.cpp
Abhinavpv28 May 3, 2026
d45fe1b
Update rrdCommon.h
Abhinavpv28 May 3, 2026
84cbf17
Update rrdRunCmdThread.h
Abhinavpv28 May 3, 2026
c274583
Update rrdRunCmdThread.c
Abhinavpv28 May 3, 2026
96eeb4c
Update rrdDynamic.c
Abhinavpv28 May 3, 2026
5afc065
Update rrdIarmEvents.c
Abhinavpv28 May 3, 2026
aa4392f
Update rrdUnitTestRunner.cpp
Abhinavpv28 May 3, 2026
57b7856
Update rrdCommon.h
Abhinavpv28 May 3, 2026
f2a41a2
Update rrdRunCmdThread.c
Abhinavpv28 May 3, 2026
577164b
Update rrdInterface.c
Abhinavpv28 May 3, 2026
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
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Autotools build artifacts
Makefile.in
aclocal.m4
autom4te.cache/
compile
config.guess
config.h.in
config.log
config.sub
configure
depcomp
install-sh
ltmain.sh
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
missing
src/Makefile.in
src/unittest/Makefile.in
config.status
Makefile
src/Makefile
src/unittest/Makefile
2 changes: 2 additions & 0 deletions src/rrdCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ typedef struct mbuffer {
bool inDynamic;
bool appendMode;
deepsleep_event_et dsEvent;
char *suffix; // Holds the suffix split from issue type string, if any
} data_buf;

/*Structure for Message Header*/
Expand Down Expand Up @@ -124,6 +125,7 @@ typedef struct cache {
char *issueString;
struct cache *next;
struct cache *prev;
char *suffix; // Persist the suffix for later use
} cacheData;

/*Structure for Device Propertiesr*/
Expand Down
4 changes: 2 additions & 2 deletions src/rrdDynamic.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,12 @@ void RRDRdmManagerDownloadRequest(issueNodeData *pissueStructNode, char *dynJSON
strcpy(appendData,rbuf->mdata);
strcat(appendData,APPEND_SUFFIX);
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Cache String updated in appendmode IssueStr:%s Length:%d\n", __FUNCTION__, __LINE__, appendData, strlen(appendData));
append_item(strdup(msgDataString), strdup(appendData));
append_item(strdup(msgDataString), strdup(appendData), rbuf->suffix);
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Setting Parameters Success and Cache Updated ...%s IssueStr:%s Length:%d\n", __FUNCTION__, __LINE__, msgDataString, appendData, strlen(appendData));
}
else
{
append_item(strdup(msgDataString), strdup((char *)rbuf->mdata));
append_item(strdup(msgDataString), strdup((char *)rbuf->mdata), rbuf->suffix);
Comment on lines +247 to +252
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Setting Parameters Success and Cache Updated ...%s IssueStr:%s Length:%d\n", __FUNCTION__, __LINE__, msgDataString, (char *)rbuf->mdata, strlen((char *)rbuf->mdata));
}
}
Expand Down
26 changes: 21 additions & 5 deletions src/rrdEventProcess.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ void processIssueTypeEvent(data_buf *rbuf)
cmdBuff = (data_buf *)malloc(sizeof(data_buf));
if (cmdBuff)
{
dataMsgLen = strlen(cmdMap[index]) + 1;
char base[128] = {0};
char local_suffix[128] = {0};
split_issue_type(cmdMap[index], base, sizeof(base), local_suffix, sizeof(local_suffix));
dataMsgLen = strlen(base) + 1;
RRD_data_buff_init(cmdBuff, EVENT_MSG, RRD_DEEPSLEEP_INVALID_DEFAULT); /* Setting Deafult Values*/
Comment on lines +82 to 86
cmdBuff->inDynamic = rbuf->inDynamic;
if(cmdBuff->inDynamic)
Expand All @@ -88,9 +91,19 @@ void processIssueTypeEvent(data_buf *rbuf)
}
cmdBuff->appendMode = rbuf->appendMode;
cmdBuff->mdata = (char *)calloc(1, dataMsgLen);

/* Store suffix for this issue type */
cmdBuff->suffix = NULL;
if (local_suffix[0] != '\0') {
cmdBuff->suffix = strdup(local_suffix);
if (cmdBuff->suffix == NULL)
{
RDK_LOG(RDK_LOG_ERROR, LOG_REMDEBUG, "[%s:%d]: Failed to allocate memory for suffix... \n", __FUNCTION__, __LINE__);
}
}
if (cmdBuff->mdata)
{
strncpy((char *)cmdBuff->mdata, cmdMap[index], dataMsgLen);
strncpy((char *)cmdBuff->mdata, base, dataMsgLen);
processIssueType(cmdBuff);
}
else
Expand All @@ -99,6 +112,11 @@ void processIssueTypeEvent(data_buf *rbuf)
}
if(cmdBuff)
{
if (cmdBuff->suffix)
{
free(cmdBuff->suffix);
cmdBuff->suffix = NULL;
}
free(cmdBuff);
cmdBuff = NULL;
}
Expand Down Expand Up @@ -639,7 +657,7 @@ static void removeSpecialCharacterfromIssueTypeList(char *str)

while (str[source] != '\0')
{
if (isalnum(str[source]) || str[source] == ',' || str[source] == '.')
if (isalnum(str[source]) || str[source] == ',' || str[source] == '.' || str[source] == '_'|| str[source] == '-')
{
str[destination] = str[source];
++destination;
Expand All @@ -648,7 +666,6 @@ static void removeSpecialCharacterfromIssueTypeList(char *str)
}
str[destination] = '\0';
}

/*
* @function issueTypeSplitter
* @brief Splits a given string into tokens based on a specified delimiter, and removes any
Expand Down Expand Up @@ -698,4 +715,3 @@ static int issueTypeSplitter(char *input_str, const char delimeter, char ***args

return cnt;
}

6 changes: 6 additions & 0 deletions src/rrdIarmEvents.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,12 @@ void _rdmManagerEventHandler(const char *owner, IARM_EventId_t eventId, void *da
}
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Cache.issueString=%s Cache.issueString.Len=%d\n", __FUNCTION__, __LINE__, cache->issueString, strlen(cache->issueString));
strncpy((char *)sendbuf->mdata, cache->issueString, recPkgNamelen);
if (cache->suffix) {
sendbuf->suffix = strdup(cache->suffix);
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Restored suffix from cache: %s\n", __FUNCTION__, __LINE__, cache->suffix);
} else {
sendbuf->suffix = NULL;
Comment on lines +341 to +345
}
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: IssueType: %s...\n", __FUNCTION__, __LINE__, (char *)sendbuf->mdata);
snprintf(sendbuf->jsonPath, strlen(eventData->rdm_pkg_info.pkg_inst_path) + rrdjsonlen + 1, "%s%s", eventData->rdm_pkg_info.pkg_inst_path, RRD_JSON_FILE);
sendbuf->inDynamic = true;
Expand Down
10 changes: 10 additions & 0 deletions src/rrdInterface.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ void RRD_data_buff_init(data_buf *sbuf, message_type_et sndtype, deepsleep_event
sbuf->inDynamic = false;
sbuf->appendMode = false;
sbuf->dsEvent = deepSleepEvent;
sbuf->suffix = NULL;
}

/*Function: RRD_data_buff_deAlloc
Expand All @@ -295,6 +296,10 @@ void RRD_data_buff_deAlloc(data_buf *sbuf)
{
free(sbuf->jsonPath);
}
if (sbuf->suffix)
{
free(sbuf->suffix);
}
free(sbuf);
}
}
Expand Down Expand Up @@ -382,6 +387,11 @@ void _rdmDownloadEventHandler(rbusHandle_t handle, rbusEvent_t const* event, rbu
}
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Cache.issueString=%s Cache.issueString.Len=%d\n", __FUNCTION__, __LINE__, cache->issueString, strlen(cache->issueString));
strncpy((char *)sendbuf->mdata, cache->issueString, recPkgNamelen);
if (cache->suffix && cache->suffix[0] != '\0')
{
sendbuf->suffix = strdup(cache->suffix);
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: Restored suffix from cache struct: %s\n", __FUNCTION__, __LINE__, cache->suffix);
}
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: IssueType: %s...\n", __FUNCTION__, __LINE__, (char *)sendbuf->mdata);
snprintf(sendbuf->jsonPath, strlen(pkg_inst_path) + rrdjsonlen + 1, "%s%s", pkg_inst_path, RRD_JSON_FILE);
sendbuf->inDynamic = true;
Expand Down
91 changes: 90 additions & 1 deletion src/rrdJsonParser.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,60 @@ void removeSpecialChar(char *str)
}
}

/*
* @function split_issue_type
* @brief Utility to split base and suffix from issue type string.
* Example: Input: Device.DeviceTime_Search-b6877385-9463-45fc-b19d-a24d77fd0790
* Output: base = Device.DeviceTime, suffix = _Search-b6877385-9463-45fc-b19d-a24d77fd0790
* @param const char *input - The input string to split.
* @param char *base - Buffer to store the base part (before the first underscore).
* @param size_t base_len - Size of the base buffer.
* @param char *suffix - Buffer to store the suffix part (from the first underscore onwards).
* @param size_t suffix_len - Size of the suffix buffer.
* @return void
*/

void split_issue_type(const char *input, char *base, size_t base_len, char *suffix, size_t suffix_len)
{
if (base && base_len > 0)
{
base[0] = '\0';
}
if (suffix && suffix_len > 0)
{
suffix[0] = '\0';
}

if (!input || !base || !suffix)
{
return;
}

if (base_len == 0 || suffix_len == 0)
{
return;
}
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: split_issue_type called with input='%s'\n", __FUNCTION__, __LINE__, input);
const char *underscore = strchr(input, '_');
if (underscore)
{
size_t b_len = underscore - input;
if (b_len >= base_len) b_len = base_len - 1;
strncpy(base, input, b_len);
base[b_len] = '\0';
strncpy(suffix, underscore, suffix_len - 1);
suffix[suffix_len - 1] = '\0';
}
else
{
strncpy(base, input, base_len - 1);
base[base_len - 1] = '\0';
suffix[0] = '\0';
}
RDK_LOG(RDK_LOG_DEBUG, LOG_REMDEBUG, "[%s:%d]: split_issue_type result: base='%s', suffix='%s'\n", __FUNCTION__, __LINE__, base, suffix);
}


/*
* @function getParamcount
* @brief Calculates the total number of nodes (elements) in the input string, excluding delimiters.
Expand Down Expand Up @@ -515,7 +569,11 @@ void checkIssueNodeInfo(issueNodeData *issuestructNode, cJSON *jsoncfg, data_buf
{
RDK_LOG(RDK_LOG_ERROR,LOG_REMDEBUG,"[%s:%d]: Memory allocation failed for rfcbuf\n",__FUNCTION__,__LINE__);
free(buff->mdata); // free rfc data
buff->mdata = NULL;
free(buff->jsonPath); // free rrd path info
buff->jsonPath = NULL;
free(buff->suffix); // free suffix
buff->suffix = NULL;
return;
}

Expand All @@ -535,7 +593,11 @@ void checkIssueNodeInfo(issueNodeData *issuestructNode, cJSON *jsoncfg, data_buf
RDK_LOG(RDK_LOG_ERROR,LOG_REMDEBUG,"[%s:%d]: %s Directory creation failed!!!\n",__FUNCTION__,__LINE__,outdir);
free(rfcbuf); // free duplicated rfc data
free(buff->mdata); // free rfc data
buff->mdata = NULL;
free(buff->jsonPath); // free rrd path info
buff->jsonPath = NULL;
free(buff->suffix); // free suffix
buff->suffix = NULL;
return;
}
else
Expand Down Expand Up @@ -576,7 +638,26 @@ void checkIssueNodeInfo(issueNodeData *issuestructNode, cJSON *jsoncfg, data_buf
else
{
RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]: Continue uploading Debug Report for %s from %s... \n",__FUNCTION__,__LINE__,buff->mdata,outdir);
status = uploadDebugoutput(outdir,buff->mdata);
// Use the persisted suffix from buff for upload
char tarName[512] = {0};
int tar_name_len = 0;
if (buff->suffix && buff->suffix[0] != '\0')
{
tar_name_len = snprintf(tarName, sizeof(tarName), "%s%s", buff->mdata, buff->suffix);
}
else
{
tar_name_len = snprintf(tarName, sizeof(tarName), "%s", buff->mdata);
}
if ((tar_name_len < 0) || ((size_t)tar_name_len >= sizeof(tarName)))
{
RDK_LOG(RDK_LOG_ERROR,LOG_REMDEBUG,"[%s:%d]: Failed to build upload file name for %s. snprintf result:%d, buffer size:%zu\n", __FUNCTION__,__LINE__,buff->mdata,tar_name_len,sizeof(tarName));
status = -1;
}
else
{
status = uploadDebugoutput(outdir, tarName);
}
if(status != 0)
{
RDK_LOG(RDK_LOG_ERROR,LOG_REMDEBUG,"[%s:%d]: RRD Upload Script Execution Failed!!! status:%d\n",__FUNCTION__,__LINE__,status);
Expand All @@ -588,14 +669,22 @@ void checkIssueNodeInfo(issueNodeData *issuestructNode, cJSON *jsoncfg, data_buf
}
free(rfcbuf); // free duplicated rfc data
free(buff->mdata); // free rfc data
buff->mdata = NULL;
free(buff->jsonPath); // free rrd path info
buff->jsonPath = NULL;
free(buff->suffix); // free suffix
buff->suffix = NULL;
}
else
{
RDK_LOG(RDK_LOG_ERROR,LOG_REMDEBUG,"[%s:%d]: No Command excuted as RRD Failed to change directory:%s\n",__FUNCTION__,__LINE__,outdir);
free(rfcbuf); // free duplicated rfc data
free(buff->mdata); // free rfc data
buff->mdata = NULL;
free(buff->jsonPath); // free rrd path info
buff->jsonPath = NULL;
free(buff->suffix); // free suffix
buff->suffix = NULL;
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/rrdJsonParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ issueData* getIssueCommandInfo(issueNodeData *issuestructNode, cJSON *jsoncfg,ch
bool processAllDebugCommand(cJSON *jsoncfg, issueNodeData *issuestructNode, char *rfcbuf);
bool processAllDeepSleepAwkMetricsCommands(cJSON *jsoncfg, issueNodeData *issuestructNode, char *rfcbuf);

void split_issue_type(const char *input, char *base, size_t base_len, char *suffix, size_t suffix_len);

#ifdef __cplusplus
}
#endif
Expand Down
29 changes: 12 additions & 17 deletions src/rrdRunCmdThread.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,17 @@ void print_items(cacheData *node)
* @param char *issueTypeData - The issue type data to store in the cache node.
* @return cacheData* - Pointer to the created cache node, or NULL on failure.
*/
cacheData* createCache( char *pkgData, char *issueTypeData)
cacheData* createCache(char *pkgData, char *issueTypeData, char *suffix)
{
cacheData *cache = NULL;
cache = (cacheData *)malloc(sizeof(cacheData));
/*Check if memory alloacted to Cache*/
if(cache)
{
cache->mdata = NULL;
cache->issueString = NULL;
cache->next = NULL;
cache->prev = NULL;
cache->mdata = pkgData;
cache->issueString = issueTypeData;
cache->suffix = suffix ? strdup(suffix) : NULL;
cache->next = NULL;
cache->prev = NULL;
}
return cache;
}
Expand All @@ -110,32 +108,25 @@ cacheData* createCache( char *pkgData, char *issueTypeData)
* @param char *issueTypeData - The issue type data to append.
* @return void
*/
void append_item(char *pkgData, char *issueTypeData)
void append_item(char *pkgData, char *issueTypeData, char *suffix)
{
RDK_LOG(RDK_LOG_INFO,LOG_REMDEBUG,"[%s:%d]: Append Item with PkgData: %s and issue Type: %s to Cache \n",__FUNCTION__,__LINE__,pkgData,issueTypeData);

cacheData *rrdCachecnode = NULL;
int i=0;
i = pthread_mutex_lock(&rrdCacheMut);
RDK_LOG(RDK_LOG_DEBUG,LOG_REMDEBUG,"[%s:%d]: RRD Mutex Lock...%d\n",__FUNCTION__,__LINE__,i);

cacheData *tmp = createCache(pkgData,issueTypeData);
/* Check If the memory is allocated for new node*/
cacheData *tmp = createCache(pkgData, issueTypeData, suffix);
Comment on lines 117 to +118
if(!tmp)
{
RDK_LOG(RDK_LOG_INFO,LOG_REMDEBUG,"[%s:%d]: Memory Allocation Failed : Cannot Append Item to Cache\n", __FUNCTION__, __LINE__);
pthread_mutex_unlock(&rrdCacheMut);
return;
return;
Comment on lines +118 to +123
}
/* create Cache and store in node's data*/

rrdCachecnode = cacheDataNode;

/*Valid Cache, add node to list*/
if(rrdCachecnode != NULL)
{
tmp->next = rrdCachecnode;
rrdCachecnode->prev = tmp;
rrdCachecnode->prev = tmp;
}
cacheDataNode = tmp;
pthread_mutex_unlock(&rrdCacheMut);
Expand Down Expand Up @@ -235,6 +226,10 @@ void freecacheDataCacheNode(cacheData **node)
{
free(rrdCachetmpnode->mdata);
free(rrdCachetmpnode->issueString);
if (rrdCachetmpnode->suffix) {
free(rrdCachetmpnode->suffix);
rrdCachetmpnode->suffix = NULL;
}
rrdCachetmpnode->mdata = NULL;
rrdCachetmpnode->issueString = NULL;
free(rrdCachetmpnode);
Expand Down
3 changes: 2 additions & 1 deletion src/rrdRunCmdThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ extern "C"

/*Public Function*/
void initCache(void);
cacheData* createCache( char *pkgData, char *issueTypeData);
cacheData* createCache(char *pkgData, char *issueTypeData, char *suffix);
void append_item(char *pkgData, char *issueTypeData, char *suffix);
void print_items(cacheData *node);
void append_item(char *pkgData, char *issueTypeData);
Comment on lines +54 to 57
Comment on lines +55 to 57
void remove_item(cacheData *cache);
Expand Down
Empty file.
Loading
Loading