Skip to content
Merged
Show file tree
Hide file tree
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
39 changes: 39 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Autotools generated files
Makefile.in
aclocal.m4
autom4te.cache/
compile
config.guess
config.log
config.sub
config.status
configure
depcomp
install-sh
ltmain.sh
missing
*.m4
*.cache

# Build artifacts
utils/config.h.in
utils/config.h
_codeql_detected_source_root

# Object files and libraries
*.o
*.lo
*.la
*.a
*.so
*.dylib
.libs/
.deps/

# Executables
*.exe
*.out
*.app

# Compiled output
Makefile
52 changes: 30 additions & 22 deletions rfcMgr/rfc_xconf_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1905,6 +1905,9 @@ int RuntimeFeatureControlProcessor::DownloadRuntimeFeatutres(DownloadData *pDwnL
RDK_LOG(RDK_LOG_ERROR, LOG_RFCMGR, "[%s][%d] Memory allocation Failed\n",__FUNCTION__, __LINE__);
return ret_value;
}

hashParam->hashvalue = nullptr;
hashParam->hashtime = nullptr;

if((pDwnLoc->pvOut != NULL) && (pHeaderDwnLoc->pvOut != NULL))
{
Expand Down Expand Up @@ -1943,7 +1946,8 @@ int RuntimeFeatureControlProcessor::DownloadRuntimeFeatutres(DownloadData *pDwnL
thisCertSel = rdkcertselector_new(DEFAULT_CONFIG, DEFAULT_HROT, certGroup);
if (thisCertSel == NULL) {
RDK_LOG(RDK_LOG_DEBUG, LOG_RFCMGR, "[%s][%d] Cert selector initialization failed\n", __FUNCTION__, __LINE__);
return cert_ret_code;
ret_value = cert_ret_code;
goto cleanup;
} else {
RDK_LOG(RDK_LOG_INFO, LOG_RFCMGR, "[%s][%d] Cert selector initialization successful\n", __FUNCTION__, __LINE__);
}
Expand All @@ -1959,10 +1963,12 @@ int RuntimeFeatureControlProcessor::DownloadRuntimeFeatutres(DownloadData *pDwnL

if (ret == MTLS_CERT_FETCH_FAILURE) {
RDK_LOG(RDK_LOG_ERROR, LOG_RFCMGR, "[%s][%d] MTLS cert failed, ret=%d\n", __FUNCTION__, __LINE__, ret);
return cert_ret_code;
ret_value = cert_ret_code;
goto cleanup;
} else if (ret == STATE_RED_CERT_FETCH_FAILURE) {
RDK_LOG(RDK_LOG_ERROR, LOG_RFCMGR, "[%s][%d] State red cert failed\n", __FUNCTION__, __LINE__);
return cert_ret_code;
ret_value = cert_ret_code;
goto cleanup;
} else {
RDK_LOG(RDK_LOG_INFO, LOG_RFCMGR, "[%s][%d] MTLS is enable\nMTLS creds for SSR fetched ret=%d\n", __FUNCTION__, __LINE__, ret);
NotifyTelemetry2Count("SYS_INFO_MTLS_enable");
Expand All @@ -1979,32 +1985,19 @@ int RuntimeFeatureControlProcessor::DownloadRuntimeFeatutres(DownloadData *pDwnL
CURLcode curl_code = (CURLcode)curl_ret_code;
const char *error_msg = curl_easy_strerror(curl_code);
RDK_LOG(RDK_LOG_DEBUG, LOG_RFCMGR, "[%s][%d] curl_easy_strerror =%s\n", __FUNCTION__, __LINE__, error_msg);

if(file_dwnl.hashData != nullptr)
{
hashParam_t* hashData = (hashParam_t*)file_dwnl.hashData;
if (hashData->hashvalue != NULL)
{
free(hashData->hashvalue);
hashData->hashvalue = NULL;
}
if (hashData->hashtime != NULL)
{
free(hashData->hashtime);
hashData->hashtime = NULL;
}
free(hashData);
file_dwnl.hashData = nullptr;
}

if (_url_validation_in_progress)
{
_url_validation_in_progress = false;
if((httpCode == 304) || (httpCode == 200))
{
return SUCCESS;
ret_value = SUCCESS;
}
else
{
ret_value = FAILURE;
}
return FAILURE;
goto cleanup;
}

switch(curl_ret_code)
Expand Down Expand Up @@ -2058,6 +2051,21 @@ int RuntimeFeatureControlProcessor::DownloadRuntimeFeatutres(DownloadData *pDwnL
ret_value= SUCCESS;
}
}

cleanup:
if (hashParam != nullptr)
{
if (hashParam->hashvalue != nullptr)
{
free(hashParam->hashvalue);
}
if (hashParam->hashtime != nullptr)
{
free(hashParam->hashtime);
}
free(hashParam);
}

return ret_value;
}

Expand Down