-The g_variant_builder_new() function's return value
should be freed by g_variant_builder_unref() when it is no longer needeed
-Release the memory allocated by g_malloc
Change-Id: I56e45cef7b2ccadc700b3af71b40a33e670e36c3
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
char *sid;
const char *tmp_appid = appid;
const char *signal_name;
char *sid;
const char *tmp_appid = appid;
const char *signal_name;
GVariantBuilder *builder;
GError *err = NULL;
GVariantBuilder *builder;
GError *err = NULL;
builder = g_variant_builder_new(G_VARIANT_TYPE("a(sss)"));
g_variant_builder_add(builder, "(sss)", pkgid,
(tmp_appid ? tmp_appid : ""), pkg_type);
builder = g_variant_builder_new(G_VARIANT_TYPE("a(sss)"));
g_variant_builder_add(builder, "(sss)", pkgid,
(tmp_appid ? tmp_appid : ""), pkg_type);
+ v = g_variant_new("(usa(sss)ss)",
+ pi->target_uid, sid, builder, key, val);
+ g_variant_builder_unref(builder);
if (g_dbus_connection_emit_signal(pi->conn, NULL,
PKGMGR_INSTALLER_DBUS_OBJECT_PATH,
PKGMGR_INSTALLER_DBUS_INTERFACE, signal_name,
if (g_dbus_connection_emit_signal(pi->conn, NULL,
PKGMGR_INSTALLER_DBUS_OBJECT_PATH,
PKGMGR_INSTALLER_DBUS_INTERFACE, signal_name,
- g_variant_new("(usa(sss)ss)", pi->target_uid, sid,
- builder, key, val), &err) != TRUE) {
ERR("failed to send dbus signal");
if (err) {
ERR("err: %s", err->message);
ERR("failed to send dbus signal");
if (err) {
ERR("err: %s", err->message);
(tmp_appid ? tmp_appid : ""), pkg_type);
gv = g_variant_new("(usa(sss)ss)", pi->target_uid, sid,
builder, key, val);
(tmp_appid ? tmp_appid : ""), pkg_type);
gv = g_variant_new("(usa(sss)ss)", pi->target_uid, sid,
builder, key, val);
+ g_variant_builder_unref(builder);
if (gv == NULL) {
ERR("failed to create GVariant instance");
return -1;
if (gv == NULL) {
ERR("failed to create GVariant instance");
return -1;
g_hash_table_foreach(pi->pkg_list, __build_multi_signal, builder);
gv = g_variant_new("(usa(sss)ss)", uid, sid, builder, key, val);
g_hash_table_foreach(pi->pkg_list, __build_multi_signal, builder);
gv = g_variant_new("(usa(sss)ss)", uid, sid, builder, key, val);
+ g_variant_builder_unref(builder);
if (gv == NULL) {
ERR("failed to create GVariant instance");
return -1;
if (gv == NULL) {
ERR("failed to create GVariant instance");
return -1;
data = malloc(data_len);
if (data == NULL) {
ERR("out of memory");
data = malloc(data_len);
if (data == NULL) {
ERR("out of memory");