!8955 modify static check to matser

From: @lyvette
Reviewed-by: @zhanghaibo5,@hangangqiang
Signed-off-by: @zhanghaibo5
pull/8955/MERGE
mindspore-ci-bot 4 years ago committed by Gitee
commit b4cc64be24

@ -48,6 +48,7 @@ int PoolingBaseCPUKernel::SetQuantParam() {
free(*pooling_quant_arg_);
free(pooling_quant_arg_);
pooling_quant_arg_ = nullptr;
*this->pooling_quant_arg_ = nullptr;
return RET_MEMORY_FAILED;
}
auto *input_tensor = in_tensors_.at(kInputIndex);

@ -61,6 +61,7 @@ int AnfImporterFromMetaGraphT::ConverterConstTensor() {
auto ret = memcpy_s(tensor_data, size, tensor->data.data(), size);
if (EOK != ret) {
MS_LOG(ERROR) << "memcpy_s error";
delete[] tensor_data;
return RET_MEMORY_FAILED;
}
param_value->set_tensor_addr(tensor_data);

@ -32,9 +32,11 @@ namespace {
void FreeTensors(std::vector<Tensor *> input_tensors, std::vector<Tensor *> output_tensors) {
for (auto &tensor : input_tensors) {
delete tensor;
tensor = nullptr;
}
for (auto &tensor : output_tensors) {
delete tensor;
tensor = nullptr;
}
input_tensors.clear();
input_tensors.shrink_to_fit();

Loading…
Cancel
Save