From: Kichan Kwon Date: Wed, 22 Apr 2020 08:19:47 +0000 (+0900) Subject: Free GVariant only if necessary X-Git-Tag: submit/tizen/20201214.073408~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ff7b51b24a2cfefa81abb13a4f1f4181f13a6dc4;p=platform%2Fcore%2Fapi%2Fruntime-info.git 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 --- 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