int i, len;
bool found = false;
- len = bt_value_array_get_size(results);
+ len = bt_value_array_get_length(results);
if (len < 0) {
BT_COMP_LOGE_STR("Error getting size of array.");
ret = -1;
error_report:
BT_COMP_LOGW("Failure to establish connection to url \"%s\"", url);
error:
- g_free(viewer_connection);
+ if (viewer_connection) {
+ live_viewer_connection_destroy(viewer_connection);
+ }
+
return NULL;
}
{
BT_COMP_LOGI("Closing connection to url \"%s\"", viewer_connection->url->str);
lttng_live_disconnect_viewer(viewer_connection);
- g_string_free(viewer_connection->url, true);
+ if (viewer_connection->url) {
+ g_string_free(viewer_connection->url, true);
+ }
if (viewer_connection->relay_hostname) {
g_string_free(viewer_connection->relay_hostname, true);
}