}
if (target_prefix) {
- bin->elf_path = g_build_path("/", target_prefix,
- path, NULL);
+ bin->elf_path = g_build_filename(target_prefix, path, NULL);
} else {
bin->elf_path = g_strdup(path);
}
{
int ret, is_build_id, is_matching = 0;
Elf_Scn *curr_section = NULL, *next_section = NULL;
- GElf_Shdr *curr_section_hdr = NULL;
+ GElf_Shdr curr_section_hdr;
if (!bin->build_id) {
goto error;
}
}
- curr_section_hdr = g_new0(GElf_Shdr, 1);
- if (!curr_section_hdr) {
- goto error;
- }
-
next_section = elf_nextscn(bin->elf_file, curr_section);
if (!next_section) {
goto error;
curr_section = next_section;
next_section = elf_nextscn(bin->elf_file, curr_section);
- curr_section_hdr = gelf_getshdr(curr_section, curr_section_hdr);
-
- if (!curr_section_hdr) {
+ if (!gelf_getshdr(curr_section, &curr_section_hdr)) {
goto error;
}
- if (curr_section_hdr->sh_type != SHT_NOTE) {
+ if (curr_section_hdr.sh_type != SHT_NOTE) {
continue;
}
}
}
error:
- g_free(curr_section_hdr);
return is_matching;
}
g_snprintf(&build_id_file[build_id_char_len], build_id_suffix_char_len,
BUILD_ID_SUFFIX);
- path = g_build_path("/", dbg_dir, BUILD_ID_SUBDIR, build_id_file, NULL);
+ path = g_build_filename(dbg_dir, BUILD_ID_SUBDIR, build_id_file, NULL);
if (!path) {
goto error;
}