Skip to content

Commit

Permalink
Fix memleak in resource code
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarofe committed May 15, 2017
1 parent c80221d commit 9f8a158
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libr/bin/format/pe/pe.c
Original file line number Diff line number Diff line change
Expand Up @@ -2316,12 +2316,14 @@ R_API void PE_(bin_pe_parse_resource)(struct PE_(r_bin_pe_obj_t) *bin) {
return;
}
if (!rs_directory) {
sdb_ht_free (dirs);
return;
}
curRes = rs_directory->NumberOfNamedEntries;
totalRes = curRes + rs_directory->NumberOfIdEntries;
if (totalRes > R_PE_MAX_RESOURCES) {
eprintf ("Error parsing resource directory\n");
sdb_ht_free (dirs);
return;
}
for (index = 0; index < totalRes; index++) {
Expand Down

0 comments on commit 9f8a158

Please sign in to comment.