Skip to content

Commit

Permalink
add munmap to avoid memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
WindySha committed May 9, 2021
1 parent 5f8dc7c commit bc2cedd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ android {
}

ndk {
abiFilter("armeabi-v7a")
// abiFilter("arm64-v8a")
// abiFilter("armeabi-v7a")
abiFilter("arm64-v8a")
}
}

Expand Down
4 changes: 4 additions & 0 deletions lib/efl_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ void *getInstructionAddressFromElf(const char *elf_file, const ASM_Instruction*
}
}
off_t off = progbits_section->sh_addr + instruc_offset;

if (elf_header != MAP_FAILED)
munmap(elf_header, size);

return (void *) ((size_t) base_address + off - bias);

error_exit:
Expand Down

0 comments on commit bc2cedd

Please sign in to comment.