bpftool: Fix wrong free call in do_show_link

BugLink: https://bugs.launchpad.net/bugs/2060097

[ Upstream commit 2adb2e0fcdf3c6d8e28a5a9c33e458e1037ae5ad ]

The error path frees wrong array, it should be ref_ctr_offsets.

Acked-by: Yafang Shao <laoar.shao@gmail.com>
Reviewed-by: Quentin Monnet <quentin@isovalent.com>
Fixes: a7795698f8 ("bpftool: Add support to display uprobe_multi links")
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20240119110505.400573-4-jolsa@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 78a4c62603f8845b93b0305de1621819980f2308)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
This commit is contained in:
Jiri Olsa
2024-01-19 12:05:00 +01:00
committed by Roxana Nicolescu
parent 76caa651ee
commit b68256bdb7
+1 -1
View File
@@ -977,7 +977,7 @@ again:
cookies = calloc(count, sizeof(__u64));
if (!cookies) {
p_err("mem alloc failed");
free(cookies);
free(ref_ctr_offsets);
free(offsets);
close(fd);
return -ENOMEM;