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
250 250
}
251 251

  
252 252
static
253
void
254
collect_rel(collect_t collect)
255
{
256
	free(collect->layer2);
257
	free(collect->track2);
258
	free(collect);
259
}
260

  
261
static
253 262
struct hammer_blockmap_layer2 *
254 263
collect_get_track(collect_t collect, hammer_off_t offset,
255 264
		  struct hammer_blockmap_layer2 *layer2)
......
271 280
void
272 281
dump_collect_table(void)
273 282
{
274
	collect_t collect;
283
	collect_t collect, tmp;
275 284
	int i;
276 285

  
277 286
	for (i = 0; i < COLLECT_HSIZE; ++i) {
278
		for (collect = CollectHash[i];
279
		     collect;
280
		     collect = collect->hnext) {
287
		for (collect = CollectHash[i]; collect; ) {
281 288
			dump_collect(collect);
289
			tmp = collect;
290
			collect = collect->hnext;
291
			collect_rel(tmp);
282 292
		}
283 293
	}
284 294
}
285
- 
    (1-1/1)