pahole: Don't keep structs in multiple RB trees

When resorting we were leaving structures in the structures__tree RB
tree while adding them from structures_list to a resorted RB tree to
then print them when --sort was used.

When using DEBUG_CHECK_LEAKS we would traverse structures__tree to free
all the structures, something not done by default to speed up tool exit.

Stop using a new 'resorted' tree and instead initialize structures__tree
to then reuse it to do the sorting.

Reported-by: Eduard Zingerman <eddyz87@gmail.com>
Co-developed-by: Eduard Zingerman <eddyz87@gmail.com>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andrii Nakryiko <andrii@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Mykola Lysenko <mykolal@fb.com>
Cc: Yonghong Song <yhs@fb.com>
Cc: bpf@vger.kernel.org
Cc: kernel-team@fb.com
Link: https://lore.kernel.org/dwarves/20230525235949.2978377-1-eddyz87@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 file changed