Coverity issue numver: 1229783
This commit fixes a potential memory leak.
[Verification] The code compiles (it's hard to provoke the code to enter
the problematic branch, so the new code wasn't executed)
Change-Id: Id560ffdffc18ff6bbf2bc987e8e0ad6853b2cdb6
ret = ml_tensors_info_clone(clone_h, this->Handle());
if (ML_ERROR_NONE != ret) {
LoggerE("ml_tensors_info_clone failed: %d (%s)", ret, get_error_message(ret));
+ ret = ml_tensors_info_destroy(clone_h);
+ if (ML_ERROR_NONE != ret) {
+ LoggerE("ml_tensors_info_destroy failed: %d (%s)", ret, get_error_message(ret));
+ }
return nullptr;
}
auto t = std::make_shared<TensorsInfo>(clone_h, cloneId);