Even if g_dbus_proxy_call_sync() returns NULL, g_variant_unref() calles.
So, we checkout if returned variable is null or not.
Change-Id: Idef3bce2021b71c690ed8055acb8b3fdb8a6cf60
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
variant = g_dbus_proxy_call_sync(service_gproxy, "check_privilege",
NULL, G_DBUS_CALL_FLAGS_NONE, -1, NULL, &dbus_err);
- if (!variant) {
+ if (variant) {
+ g_variant_unref(variant);
+ } else if (dbus_err) {
ERR("Failed to check_zigbee_privilege [%s]", dbus_err->message);
if (strstr(dbus_err->message, "AccessDenied"))
result = ZIGBEE_ERROR_PERMISSION_DENIED;
g_error_free(dbus_err);
}
- g_variant_unref(variant);
return result;
}