Skip to content

Commit

Permalink
Revert "[TO BE REVERTED] bin.c: Double-free"
Browse files Browse the repository at this point in the history
This reverts commit f0378a8.
  • Loading branch information
kazarmy committed May 2, 2024
1 parent 3801be8 commit ee8f497
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions librz/bin/bin.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,13 @@ RZ_API void rz_bin_reloc_free(RZ_NULLABLE RzBinReloc *reloc) {
if (!reloc) {
return;
}
rz_bin_import_free(reloc->import);
rz_bin_symbol_free(reloc->symbol);
/**
* TODO: leak in bin_elf, but it will cause double free in bin_pe if free here,
* Because in the bin_elf implementation RzBinObject->imports and RzBinObject->relocs->imports
* are two pieces of data, but they are linked to each other in bin_pe
*/
// rz_bin_import_free(reloc->import);
// rz_bin_symbol_free(reloc->symbol);
free(reloc);
}

Expand Down

0 comments on commit ee8f497

Please sign in to comment.