The function "g_dbus_proxy_call_sync" consumes the floating GVariant parameter
So from the second loop, the variable is consumed, causing incorrect memory access
This patch changes GVariant variable from floating reference
to full reference using g_variant_ref_sink
Change-Id: I11f97ee20f72a7540413e60d921950fd0a5cdd90
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
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;
}
if (conn)
g_object_unref(conn);
+ if (param)
+ g_variant_unref(param);
return ret;
}