!246 修改data_storage cppcheck告警

Merge pull request !246 from dingxiaochen/master
This commit is contained in:
openharmony_ci
2023-03-17 06:30:58 +00:00
committed by Gitee
+4
View File
@@ -75,6 +75,10 @@ int ParserUtil::ParserPdpProfileJson(std::vector<PdpProfile> &vec)
DATA_STORAGE_LOGE("ParserUtil::ParserPdpProfileJson LoaderJsonFile is fail!\n");
return ret;
}
if (content == nullptr) {
DATA_STORAGE_LOGE("ParserUtil::content is nullptr!");
return static_cast<int>(LoadProFileErrorType::FILE_PARSER_ERROR);
}
const int contentLength = strlen(content);
const std::string rawJson(content);
free(content);