[Coverity] Fix resource leak submit/tizen/20200212.101153
authorgichan-jang <gichan2.jang@samsung.com>
Wed, 12 Feb 2020 02:03:06 +0000 (11:03 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Wed, 12 Feb 2020 05:53:22 +0000 (21:53 -0800)
Fix coverity issues caused by resource leak.
CID: 1123663, 1123830, 1123853, 1123860

Signed-off-by: gichan-jang <gichan2.jang@samsung.com>
tests/tizen_capi/unittest_tizen_capi.cc

index c49fe2f..740b26b 100644 (file)
@@ -995,6 +995,10 @@ TEST (nnstreamer_capi_src, failure_03_n)
 
   status = ml_tensors_data_destroy (data);
   EXPECT_EQ (status, ML_ERROR_NONE);
+
+  status = ml_tensors_info_destroy (info);
+  EXPECT_EQ (status, ML_ERROR_NONE);
+
 }
 
 /**
@@ -2618,6 +2622,9 @@ TEST (nnstreamer_capi_singleshot, set_input_info_fail)
   status = ml_single_close (single);
   EXPECT_EQ (status, ML_ERROR_NONE);
 
+  status = ml_tensors_info_destroy (in_info);
+  EXPECT_EQ (status, ML_ERROR_NONE);
+
   g_free (test_model);
 }
 
@@ -2673,6 +2680,9 @@ TEST (nnstreamer_capi_singleshot, set_input_info_fail_01)
   status = ml_single_close (single);
   EXPECT_EQ (status, ML_ERROR_NONE);
 
+  status = ml_tensors_info_destroy (in_info);
+  EXPECT_EQ (status, ML_ERROR_NONE);
+
   g_free (test_model);
 }
 
@@ -2738,6 +2748,9 @@ TEST (nnstreamer_capi_singleshot, set_input_info_success)
   status = ml_single_close (single);
   EXPECT_EQ (status, ML_ERROR_NONE);
 
+  status = ml_tensors_info_destroy (in_info);
+  EXPECT_EQ (status, ML_ERROR_NONE);
+
   g_free (test_model);
 }