diff --git a/libsearch/data-collecter.cpp b/libsearch/data-collecter.cpp index 8c536e4..bcf1ac5 100644 --- a/libsearch/data-collecter.cpp +++ b/libsearch/data-collecter.cpp @@ -22,11 +22,14 @@ void DataCollecter::collectLaunchEvent(const QString &plugin, const QString &button) { - KCustomProperty property[2]; - property[0].key = plugin.toLocal8Bit().data(); - property[0].value = button.toLocal8Bit().data(); + KCustomProperty *property = new KCustomProperty; + property->key = strdup(plugin.toLocal8Bit().data()); + property->value = strdup(button.toLocal8Bit().data()); KTrackData *node = kdk_dia_data_init(KEVENTSOURCE_DESKTOP,KEVENT_CLICK); kdk_dia_append_custom_property(node,property,1); - kdk_dia_upload_default(node, QStringLiteral("launch").toLocal8Bit().data(), plugin.toLocal8Bit().data()); + kdk_dia_upload_default(node, strdup(QStringLiteral("launch").toLocal8Bit().data()), strdup(plugin.toLocal8Bit().data())); kdk_dia_data_free(node); + free(property->key); + free(property->value); + delete property; }