From cf8ff3b1d1093e137ca1b55db390c59f9752cc54 Mon Sep 17 00:00:00 2001 From: Kichan Kwon Date: Wed, 22 Apr 2020 17:19:47 +0900 Subject: [PATCH] Free GVariant only if necessary - g_dbus_connection_call_sync consumes GVariant argument on this situations - on succeed - on failed with setting GErr - So, we have to free only if it is failed without setting GErr Change-Id: I39466f7ac0cddb229bd61ace5f3b9687f80e069f Signed-off-by: Kichan Kwon (cherry picked from commit ff7b51b24a2cfefa81abb13a4f1f4181f13a6dc4) --- src/runtime_info_usage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime_info_usage.c b/src/runtime_info_usage.c index ff04310..64120d2 100644 --- a/src/runtime_info_usage.c +++ b/src/runtime_info_usage.c @@ -176,7 +176,7 @@ static GVariant *runtime_info_dbus_request_usage_info(runtime_info_usage_type_e *error = RUNTIME_INFO_ERROR_PERMISSION_DENIED; else *error = RUNTIME_INFO_ERROR_REMOTE_IO; - if (args_in) + if (args_in && !err) g_variant_unref(args_in); return NULL; //LCOV_EXCL_STOP -- 2.34.1