Fix memory leak
[platform/core/appfw/shortcut.git] / lib / src / shortcut_internal.c
index d8f4238..2194ab9 100755 (executable)
@@ -378,6 +378,9 @@ int _send_async_shortcut(GVariant *body, struct result_cb_item *cb_item, char *c
                /* LCOV_EXCL_STOP */
        }
 
+       if (g_variant_is_floating(body))
+                g_variant_ref(body);
+
        if (body != NULL)
                g_dbus_message_set_body(msg, body);
 
@@ -391,6 +394,9 @@ int _send_async_shortcut(GVariant *body, struct result_cb_item *cb_item, char *c
                        (GAsyncReadyCallback)_send_message_with_reply_sync_cb,
                        cb_item);
 
+       if (msg)
+               g_object_unref(msg);
+
        SHORTCUT_DBG("_send_async_shortcut done !!");
        return SHORTCUT_ERROR_NONE;
 }