Skip to content

Commit

Permalink
Fix several memory leaks (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
haochengxia committed Jun 14, 2024
1 parent bd1cf8b commit 9d0e80d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libCacheSim/bin/cachesim/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ int main(int argc, char **argv) {
}
fclose(output_file);

if (args.n_cache_size * args.n_eviction_algo > 0)
my_free(sizeof(cache_stat_t) * args.n_cache_size * args.n_eviction_algo, result);

free_arg(&args);

return 0;
Expand Down
2 changes: 2 additions & 0 deletions libCacheSim/bin/cachesim/sim.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ void simulate(reader_t *reader, cache_t *cache, int report_interval,
}

#endif
free_request(req);
cache->cache_free(cache);
}

#ifdef __cplusplus
Expand Down

0 comments on commit 9d0e80d

Please sign in to comment.