diff --git a/rfcMgr/rfc_xconf_handler.cpp b/rfcMgr/rfc_xconf_handler.cpp index a2c6863..08d8171 100644 --- a/rfcMgr/rfc_xconf_handler.cpp +++ b/rfcMgr/rfc_xconf_handler.cpp @@ -21,6 +21,7 @@ #include "rfc_xconf_handler.h" #include "rfc_common.h" +#include #include "rfcapi.h" #include "rfc_mgr_json.h" #include "mtlsUtils.h" @@ -1297,7 +1298,7 @@ void RuntimeFeatureControlProcessor::clearDB(void) set_RFCProperty(name, ClearDB, clearValue); set_RFCProperty(name, BootstrapClearDB, clearValue); - set_RFCProperty(name, ConfigChangeTimeKey, ConfigChangeTime); + set_RFCProperty(name, std::move(ConfigChangeTimeKey), ConfigChangeTime); RDK_LOG(RDK_LOG_INFO, LOG_RFCMGR, "[%s][%d] Clearing DB Value: %s\n", __FUNCTION__,__LINE__,ClearDB.c_str()); RDK_LOG(RDK_LOG_INFO, LOG_RFCMGR, "[%s][%d] Bootstrap Clearing DB Value: %s\n", __FUNCTION__,__LINE__,BootstrapClearDB.c_str()); @@ -1466,7 +1467,7 @@ void RuntimeFeatureControlProcessor::updateHashAndTimeInDB(char *curlHeaderResp) // Output the value RDK_LOG(RDK_LOG_INFO, LOG_RFCMGR, "configSetHash value: %s\n", configSetHashValue.c_str()); - updateHashInDB(configSetHashValue); + updateHashInDB(std::move(configSetHashValue)); } else { RDK_LOG(RDK_LOG_ERROR, LOG_RFCMGR, "configSetHash not found in httpHeader!"); } @@ -1474,7 +1475,7 @@ void RuntimeFeatureControlProcessor::updateHashAndTimeInDB(char *curlHeaderResp) std::time_t timestamp = std::time(nullptr); // Get current timestamp std::string timestampString = std::to_string(timestamp); - updateTimeInDB(timestampString); + updateTimeInDB(std::move(timestampString)); std::fstream fs; fs.open(RFC_SYNC_DONE, std::ios::out); @@ -1507,9 +1508,9 @@ bool RuntimeFeatureControlProcessor::IsDirectBlocked() else { RDK_LOG(RDK_LOG_INFO, LOG_RFCMGR,"[%s][%d] RFC: Last direct failed blocking has expired, removing %s, allowing direct \n", __FUNCTION__, __LINE__, DIRECT_BLOCK_FILENAME); - if (remove(DIRECT_BLOCK_FILENAME) != 0) + if (remove(DIRECT_BLOCK_FILENAME) != 0 && errno != ENOENT) { - RDK_LOG(RDK_LOG_ERROR, LOG_RFCMGR,"[%s][%d]Failed to remove file %s\n", __FUNCTION__, __LINE__, DIRECT_BLOCK_FILENAME); + RDK_LOG(RDK_LOG_ERROR, LOG_RFCMGR,"[%s][%d]Failed to remove file %s, errno=%d\n", __FUNCTION__, __LINE__, DIRECT_BLOCK_FILENAME,errno); } } } @@ -1988,7 +1989,18 @@ int RuntimeFeatureControlProcessor::DownloadRuntimeFeatutres(DownloadData *pDwnL } if(file_dwnl.hashData != nullptr) { + if(file_dwnl.hashData->hashvalue != nullptr) + { + free(file_dwnl.hashData->hashvalue); + file_dwnl.hashData->hashvalue = nullptr; + } + if(file_dwnl.hashData->hashtime != nullptr) + { + free(file_dwnl.hashData->hashtime); + file_dwnl.hashData->hashtime = nullptr; + } free(file_dwnl.hashData); + file_dwnl.hashData = nullptr; } if (_url_validation_in_progress) @@ -2021,7 +2033,10 @@ int RuntimeFeatureControlProcessor::DownloadRuntimeFeatutres(DownloadData *pDwnL case 83: case 90: case 91: - NotifyTelemetry2ErrorCode(curl_ret_code); + NotifyTelemetry2ErrorCode(curl_ret_code); + break; + default: + break; } if((curl_ret_code == 0) && (httpCode == 404)) @@ -2480,7 +2495,7 @@ void RuntimeFeatureControlProcessor::processXconfResponseConfigDataPart(JSON *fe } std::string data = "TR181: " + newKey + " " + newValue; - paramList.push_back(data); + paramList.push_back(std::move(data)); } updateTR181File(TR181_FILE_LIST, paramList); @@ -2887,7 +2902,7 @@ int RuntimeFeatureControlProcessor::ProcessXconfUrl(const char *XconfUrl) std::string FQDN = _xconf_server_url; _xconf_server_url = std::string(XconfUrl) + "/featureControl/getSettings"; std::stringstream url = CreateXconfHTTPUrl(); - _xconf_server_url = FQDN; + _xconf_server_url = std::move(FQDN); DownloadData DwnLoc, HeaderDwnLoc; InitDownloadData(&DwnLoc);