Project

General

Profile

Submit #2766 ยป 0001-sbin-hammer-fix-potential-memory-leak.patch

tkusumi, 01/12/2015 08:11 AM

View differences:

sbin/hammer/cmd_blockmap.c
}
static
void
collect_rel(collect_t collect)
{
free(collect->layer2);
free(collect->track2);
free(collect);
}
static
struct hammer_blockmap_layer2 *
collect_get_track(collect_t collect, hammer_off_t offset,
struct hammer_blockmap_layer2 *layer2)
......
void
dump_collect_table(void)
{
collect_t collect;
collect_t collect, tmp;
int i;
for (i = 0; i < COLLECT_HSIZE; ++i) {
for (collect = CollectHash[i];
collect;
collect = collect->hnext) {
for (collect = CollectHash[i]; collect; ) {
dump_collect(collect);
tmp = collect;
collect = collect->hnext;
collect_rel(tmp);
}
}
}
    (1-1/1)