[test] Fix mem leak of ml_option
authorYongjoo Ahn <yongjoo1.ahn@samsung.com>
Wed, 22 Mar 2023 08:09:50 +0000 (17:09 +0900)
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>
Fri, 24 Mar 2023 03:13:43 +0000 (12:13 +0900)
- Add missing `ml_option_destroy`

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

index bcd5657..606d91e 100644 (file)
@@ -930,7 +930,8 @@ TEST_F (MLServiceAgentTest, model_ml_option_get_00_n)
   status = ml_option_get (info_h, key, (void **) &value);
   EXPECT_EQ (ML_ERROR_INVALID_PARAMETER, status);
 
-  g_free (info_h);
+  status = ml_option_destroy (info_h);
+  EXPECT_EQ (ML_ERROR_NONE, status);
 }
 
 /**