Fix: perf counters context: error handling on type allocation
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 17 Mar 2021 19:24:59 +0000 (15:24 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 17 Mar 2021 19:24:59 +0000 (15:24 -0400)
Found by Coverity:
** CID 1450865:  Resource leaks  (RESOURCE_LEAK)
/liblttng-ust/lttng-context-perf-counters.c: 606 in lttng_add_perf_counter_to_ct)

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I9b0cf29ceb4f8c95f0905455cda4c157c7a37165

liblttng-ust/lttng-context-perf-counters.c

index 53ff3cbc10235ff2b6e992119861792ed0733499..f8241c392872ff53230c55b7201589794a8c323b 100644 (file)
@@ -548,7 +548,7 @@ int lttng_add_perf_counter_to_ctx(uint32_t type,
                        lttng_alignof(uint64_t) * CHAR_BIT,
                        lttng_is_signed_type(uint64_t),
                        BYTE_ORDER, 10);
-       if (!type) {
+       if (!ust_type) {
                ret = -ENOMEM;
                goto type_alloc_error;
        }
This page took 0.027538 seconds and 4 git commands to generate.