From a9d86fd1c36a680eac282bd982896f78631af3ab Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 17 Mar 2021 15:23:26 -0400 Subject: [PATCH 1/1] Fix: lttng_ust_destroy_type: add missing free() for compound types Signed-off-by: Mathieu Desnoyers Change-Id: Iea05b0cad779adef251ec000e4c126493e17aff8 --- liblttng-ust/ust-events-internal.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/liblttng-ust/ust-events-internal.h b/liblttng-ust/ust-events-internal.h index 5466f25e..e9f14fc4 100644 --- a/liblttng-ust/ust-events-internal.h +++ b/liblttng-ust/ust-events-internal.h @@ -466,6 +466,7 @@ void lttng_ust_destroy_type(struct lttng_ust_type_common *type) struct lttng_ust_type_enum *enum_type = (struct lttng_ust_type_enum *) type; lttng_ust_destroy_type(enum_type->container_type); + free(enum_type); break; } case lttng_ust_type_array: @@ -473,6 +474,7 @@ void lttng_ust_destroy_type(struct lttng_ust_type_common *type) struct lttng_ust_type_array *array_type = (struct lttng_ust_type_array *) type; lttng_ust_destroy_type(array_type->elem_type); + free(array_type); break; } case lttng_ust_type_sequence: @@ -480,6 +482,7 @@ void lttng_ust_destroy_type(struct lttng_ust_type_common *type) struct lttng_ust_type_sequence *sequence_type = (struct lttng_ust_type_sequence *) type; lttng_ust_destroy_type(sequence_type->elem_type); + free(sequence_type); break; } case lttng_ust_type_struct: @@ -489,6 +492,7 @@ void lttng_ust_destroy_type(struct lttng_ust_type_common *type) for (i = 0; i < struct_type->nr_fields; i++) lttng_ust_destroy_type(struct_type->fields[i]->type); + free(struct_type); break; } default: -- 2.34.1