On Aug 19, 6:50am, Maxime Villard wrote: } Le 18/08/2014 19:16, Alistair G. Crooks a écrit : } > } > Module Name: src } > Committed By: agc } > Date: Mon Aug 18 17:16:42 UTC 2014 } > } > Modified Files: } > src/sys/dev/dm: dm_target_stripe.c } > } > Log Message: } > Avoid a memory leak - from maxv } > } > To generate a diff of this commit: } > cvs rdiff -u -r1.19 -r1.20 src/sys/dev/dm/dm_target_stripe.c } } I have a doubt for this one. } } for (strpi = DM_STRIPE_DEV_OFFSET; strpi < strpc; strpi += 2) { } printf("Stripe target device name %s -- offset %s\n", } argv[strpi], argv[strpi+1]); } } tlc = kmem_alloc(sizeof(*tlc), KM_NOSLEEP); } if ((tlc->pdev = dm_pdev_insert(argv[strpi])) == NULL) { } kmem_free(tsc, sizeof(*tsc)); } XXX kmem_free(tlc, sizeof(*tlc)); } return ENOENT; } } } tlc->offset = atoi(argv[strpi+1]); } } /* Insert striping device to linked list. */ } XXX TAILQ_INSERT_TAIL(&tsc->stripe_devs, tlc, entries); } } } } The tlc's inserted into the list are not freed, are they?
Notice the "return ENOENT" after the two calls to kmem_free(). If the first XXX line is executed then the second XXX line won't be. }-- End of excerpt from Maxime Villard