memleak fix: unittest-common forgot to unref
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Wed, 30 Aug 2023 07:40:03 +0000 (16:40 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Thu, 31 Aug 2023 04:26:59 +0000 (13:26 +0900)
Unref gst-buffer that is allocated in the test case.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
tests/common/unittest_common.cc

index 9839f2f..040180f 100644 (file)
@@ -2125,6 +2125,8 @@ TEST (commonUtil, createTensorBufferInvalidConfig_n)
   in = gst_buffer_new_allocate (NULL, 200, NULL);
   out = gst_tensor_buffer_from_config (in, &config);
   EXPECT_FALSE (out != NULL);
+
+  gst_buffer_unref (out);
 }
 
 /**
@@ -2148,10 +2150,14 @@ TEST (commonUtil, createTensorBufferNullParam_n)
   in = gst_buffer_new_allocate (NULL, data_size, NULL);
   out = gst_tensor_buffer_from_config (NULL, &config);
   EXPECT_FALSE (out != NULL);
+  gst_buffer_unref (in);
+  gst_buffer_unref (out);
 
   in = gst_buffer_new_allocate (NULL, data_size, NULL);
   out = gst_tensor_buffer_from_config (in, NULL);
   EXPECT_FALSE (out != NULL);
+
+  gst_buffer_unref (out);
 }
 
 /**
@@ -2175,6 +2181,8 @@ TEST (commonUtil, createTensorBufferInvalidSize_n)
   in = gst_buffer_new_allocate (NULL, data_size, NULL);
   out = gst_tensor_buffer_from_config (in, &config);
   EXPECT_FALSE (out != NULL);
+
+  gst_buffer_unref (out);
 }
 
 /**