X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcommon%2Fuserspace-probe.c;h=37bdcc7b1b7897ac3ef588b4839744995dd17591;hb=b33f872b72c7c01ded6bd7d0604d6aec7fa5721b;hp=ea3c93bcde840242d4871084394f6ebe0d75ec11;hpb=f4d0bb2e92e94cb5eb304c8e92afcc804591539d;p=lttng-tools.git diff --git a/src/common/userspace-probe.c b/src/common/userspace-probe.c index ea3c93bcd..37bdcc7b1 100644 --- a/src/common/userspace-probe.c +++ b/src/common/userspace-probe.c @@ -38,26 +38,7 @@ void lttng_userspace_probe_location_lookup_method_destroy( return; } - switch (lookup_method->type) { - case LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_FUNCTION_ELF: - { - struct lttng_userspace_probe_location_lookup_method_elf *elf_method = - container_of(lookup_method, - struct lttng_userspace_probe_location_lookup_method_elf, parent); - free(elf_method); - break; - } - case LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_TRACEPOINT_SDT: - { - struct lttng_userspace_probe_location_lookup_method_sdt *sdt_method = - container_of(lookup_method, - struct lttng_userspace_probe_location_lookup_method_sdt, parent); - free(sdt_method); - break; - } - default: - break; - } + free(lookup_method); } struct lttng_userspace_probe_location_lookup_method * @@ -169,7 +150,7 @@ void lttng_userspace_probe_location_destroy( lttng_userspace_probe_location_tracepoint_destroy(location); break; default: - free(location); + abort(); } } @@ -764,7 +745,7 @@ end: return ret; } -struct lttng_userspace_probe_location_lookup_method * +const struct lttng_userspace_probe_location_lookup_method * lttng_userspace_probe_location_get_lookup_method( const struct lttng_userspace_probe_location *location) {