[Test] fix memory leak
authorSeungha Son <linuxias@gmail.com>
Sat, 1 Apr 2023 15:54:29 +0000 (00:54 +0900)
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>
Mon, 3 Apr 2023 02:26:36 +0000 (11:26 +0900)
 When running the test, the memory is not released,
 fx the memory-leak by releasing the memory before the end of the test.

Signed-off-by: Seungha Son <linuxias@gmail.com>
tests/unittest_nnstreamer-edge.cc

index edc5525258047883217d04647c14d3d86863f779..df6b80945d4260f9b097ac16da375bb55b421980 100644 (file)
@@ -2091,6 +2091,8 @@ TEST(edgeDataSerialize, normal)
 
   ret = nns_edge_data_destroy (dest_h);
   EXPECT_EQ (ret, NNS_EDGE_ERROR_NONE);
+
+  SAFE_FREE(serialized_data);
 }
 
 
@@ -3580,6 +3582,8 @@ TEST(edgeQueue, pushInvalidParam03_n)
   EXPECT_FALSE (nns_edge_queue_push (queue_h, data, 0U, NULL));
 
   EXPECT_TRUE (nns_edge_queue_destroy (queue_h));
+
+  SAFE_FREE(data);
 }
 
 /**