Skip to content

Commit

Permalink
Merge pull request #162 from flaviojs/fix-memory-leak-ilt_load_table
Browse files Browse the repository at this point in the history
Fix memory leak in ilt_load_table
  • Loading branch information
grossmj authored Mar 11, 2024
2 parents 82a0a3a + 5403cf4 commit 7390cf9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions common/insn_lookup.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,12 +462,16 @@ static insn_lookup_t *ilt_load_table(FILE *fd)
fseek(fd,0,SEEK_SET);

for(i=0;i<RFC_ARRAY_NUMBER;i++) {
if (ilt_load_rfct(fd,ilt) == -1)
if (ilt_load_rfct(fd,ilt) == -1) {
ilt_destroy(ilt);
return NULL;
}
}

if (ilt_check_cached_table(ilt) == -1)
if (ilt_check_cached_table(ilt) == -1) {
ilt_destroy(ilt);
return NULL;
}

return ilt;
}
Expand Down

0 comments on commit 7390cf9

Please sign in to comment.