Fix: client_list_element leak on failure to evaluate a condition
[lttng-tools.git] / src / bin / lttng-sessiond / notification-thread-events.c
index 327ea7fc34907119cde2662bb42ee34262179f5c..6777fd6dd1f3b34f228981bd4b9aaf30a27dd07e 100644 (file)
@@ -295,7 +295,7 @@ unsigned long lttng_condition_buffer_usage_hash(
 
                val = condition->threshold_ratio.value * (double) UINT32_MAX;
                hash ^= hash_key_u64(&val, lttng_ht_seed);
-       } else if (condition->threshold_ratio.set) {
+       } else if (condition->threshold_bytes.set) {
                uint64_t val;
 
                val = condition->threshold_bytes.value;
@@ -469,7 +469,7 @@ int evaluate_condition_for_client(struct lttng_trigger *trigger,
        ret = evaluate_condition(condition, &evaluation, state, NULL,
                        last_sample, channel_info->capacity);
        if (ret) {
-               WARN("[notification-thread] Fatal error occured while evaluating a newly subscribed-to condition");
+               WARN("[notification-thread] Fatal error occurred while evaluating a newly subscribed-to condition");
                goto end;
        }
 
@@ -565,6 +565,7 @@ int notification_thread_client_subscribe(struct notification_client *client,
                        client, state)) {
                WARN("[notification-thread] Evaluation of a condition on client subscription failed, aborting.");
                ret = -1;
+               free(client_list_element);
                goto end_unlock;
        }
 
This page took 0.02439 seconds and 5 git commands to generate.