提交 d332e4d2 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!5581 clean static check

Merge pull request !5581 from cjh9368/static_check_r0.7
......@@ -52,7 +52,7 @@ std::vector<Tensor *> GetCNodeInputTensors(const CNodePtr &CNode) {
delete lite_tensor;
return input_tensors;
}
auto tensor_data = reinterpret_cast<uint8_t *>(malloc(lite_tensor_size / sizeof(char)));
auto tensor_data = new (std::nothrow) uint8_t[lite_tensor_size / sizeof(char)];
if (tensor_data == nullptr) {
MS_LOG(ERROR) << "tensor_data is nullptr";
delete lite_tensor;
......@@ -92,7 +92,7 @@ ParameterPtr CreateNewParamter(const FuncGraphPtr &func_graph, Tensor *tensor) {
}
auto ret = memcpy_s(tensor_data, size * sizeof(float), tensor->Data(), size * sizeof(float));
if (ret != EOK) {
delete tensor_data;
delete[] tensor_data;
MS_LOG(ERROR) << "memcpy error: " << ret;
return nullptr;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册