On Saturday 11 July 2009 11:38:09 Stuart Henderson wrote: > On 2009/07/11 11:15, Remco wrote: > > I was wondering, isn't it true that in code like this, > > > > allocated_mem = malloc(...); > > ... > > if (error_condition) > > err(...); > > ... > > free(allocated_mem); > > > > the 'allocated_mem' will get lost into space if 'error_condition' occurs > > ? > > > > If so, the 'bio_createraid', and the 'bio_parse_devlist' function which > > is called by 'bio_createraid', might leak memory this way on several > > occasions. > > The err(), verr(), errx(), and verrx() functions do not return, but > exit with the value of the argument eval. > > allocated_mem is freed when the process exits.
Thanks, I wasn't aware of that.