Skip to content

Commit 936e8a2

Browse files
committed
Fix: probe location lookup method destroy free wrong structure
Signed-off-by: Francis Deslauriers <[email protected]>
1 parent 2061366 commit 936e8a2

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/common/userspace-probe.c

+12-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,18 @@ lttng_userspace_probe_location_lookup_method_get_type(
3232
void lttng_userspace_probe_location_lookup_method_destroy(
3333
struct lttng_userspace_probe_location_lookup_method *lookup_method)
3434
{
35-
free(lookup_method);
35+
switch (lookup_method->type) {
36+
case LTTNG_USERSPACE_PROBE_LOCATION_LOOKUP_METHOD_TYPE_FUNCTION_ELF:
37+
{
38+
struct lttng_userspace_probe_location_lookup_method_elf *elf_method =
39+
container_of(lookup_method,
40+
struct lttng_userspace_probe_location_lookup_method_elf, parent);
41+
free(elf_method);
42+
break;
43+
}
44+
default:
45+
break;
46+
}
3647
}
3748

3849
struct lttng_userspace_probe_location_lookup_method *

0 commit comments

Comments
 (0)