Fix: lttng_ust_destroy_type: add missing free() for compound types
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 17 Mar 2021 19:23:26 +0000 (15:23 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 17 Mar 2021 19:23:26 +0000 (15:23 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: Iea05b0cad779adef251ec000e4c126493e17aff8

liblttng-ust/ust-events-internal.h

index 5466f25e2216e9eefc961a14e7dd1463e2858e44..e9f14fc480e2139bdfe68b6b8edea742b0e8b696 100644 (file)
@@ -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:
This page took 0.025751 seconds and 4 git commands to generate.