static
int bin_info_set_elf_file(struct bin_info *bin)
{
- int elf_fd;
+ int elf_fd = -1;
Elf *elf_file = NULL;
if (!bin) {
return 0;
error:
- close(elf_fd);
+ if (elf_fd >= 0) {
+ close(elf_fd);
+ }
elf_end(elf_file);
return -1;
}
free(src_loc->filename);
g_free(src_loc);
}
+
/**
* Append a string representation of an address offset to an existing
* string.