Skip to content

Commit

Permalink
fix memory leak in rebind_symbols_image (facebook#49)
Browse files Browse the repository at this point in the history
* fix memory leak in rebind_symbols_image
  • Loading branch information
rosen0510 authored and dinhvh committed Feb 2, 2018
1 parent 90e9f26 commit 06cfb58
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fishhook.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,9 @@ int rebind_symbols_image(void *header,
struct rebindings_entry *rebindings_head = NULL;
int retval = prepend_rebindings(&rebindings_head, rebindings, rebindings_nel);
rebind_symbols_for_image(rebindings_head, (const struct mach_header *) header, slide);
if (rebindings_head->rebindings) {
free(rebindings_head->rebindings);
}
free(rebindings_head);
return retval;
}
Expand Down

0 comments on commit 06cfb58

Please sign in to comment.