[test] Fix mem leak in tflite unittest
authorYongjoo Ahn <yongjoo1.ahn@samsung.com>
Thu, 8 Feb 2024 07:19:47 +0000 (16:19 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Wed, 14 Feb 2024 05:59:13 +0000 (14:59 +0900)
- Fix memory leak by unref

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
tests/nnstreamer_filter_tensorflow2_lite/unittest_filter_tensorflow2_lite.cc

index e0ca04a..1172cf5 100644 (file)
@@ -110,6 +110,9 @@ check_output (GstElement *element, GstBuffer *buffer, gpointer user_data)
   }
 
   EXPECT_EQ (max_idx, 951U);
+
+  gst_memory_unmap (mem_res, &info_res);
+  gst_memory_unref (mem_res);
 }
 
 /**
@@ -194,6 +197,7 @@ TEST (nnstreamerFilterTensorFlow2Lite, quantModelResult)
 
   EXPECT_EQ (setPipelineStateSync (gstpipe, GST_STATE_NULL, UNITTEST_STATECHANGE_TIMEOUT), 0);
 
+  gst_object_unref (sink_handle);
   gst_object_unref (gstpipe);
   g_free (pipeline);
   g_free (model_file);