From 1dd1d12351a539a8e7117bbceb940c36bdfde322 Mon Sep 17 00:00:00 2001 From: Kwang Son Date: Thu, 10 Jun 2021 14:42:07 +0900 Subject: [PATCH] AddressSanitizer: attempting double-free mBackend is not allocated by Load function. return error code is enough. Change-Id: I3ece30b743d08892c97c2d325a14bd53685bdd43 Signed-off-by: Kwang Son --- mv_machine_learning/mv_inference/inference/src/Inference.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/mv_machine_learning/mv_inference/inference/src/Inference.cpp b/mv_machine_learning/mv_inference/inference/src/Inference.cpp index b9258af..17849bf 100755 --- a/mv_machine_learning/mv_inference/inference/src/Inference.cpp +++ b/mv_machine_learning/mv_inference/inference/src/Inference.cpp @@ -1002,7 +1002,6 @@ namespace inference // Request model loading to backend engine. ret = mBackend->Load(models, model_format); if (ret != INFERENCE_ENGINE_ERROR_NONE) { - delete mBackend; LOGE("Fail to load model"); mCanRun = false; std::vector().swap(models); @@ -1014,7 +1013,6 @@ namespace inference // Prepare input and output tensor buffers. ret = PrepareTenosrBuffers(); if (ret != INFERENCE_ENGINE_ERROR_NONE) { - delete mBackend; LOGE("Fail to prepare buffer"); mCanRun = false; return ret; -- 2.7.4