Fix usage of GVariant in "g_dbus_proxy_call_sync"
[platform/core/appfw/app2sd.git] / plugin / app2sd / lib / app2sd_client_interface.c
index 739ef05..efbf557 100644 (file)
@@ -69,10 +69,15 @@ static int __app2sd_call_server_method(const gchar *method_name,
        GError *error = NULL;
        GVariant *value = NULL;
 
+       if (param)
+               g_variant_ref_sink(param);
+
        /* get gdbus connection */
        ret = app2sd_gdbus_shared_connection(&conn);
        if (ret) {
                _E("app2sd error : dbus connection error");
+               if (param)
+                       g_variant_unref(param);
                return ret;
        }
 
@@ -119,6 +124,8 @@ static int __app2sd_call_server_method(const gchar *method_name,
 
        if (conn)
                g_object_unref(conn);
+       if (param)
+               g_variant_unref(param);
 
        return ret;
 }