On 02/16/2010 06:07 PM, [email protected] wrote:
Log: Make sure we don't leak file descriptors.if (new_m->shmkey == (key_t)-1) { + apr_file_close(file); return errno; }
File will be closed when the pool gets destroyed. Closing here has little advantages cause the pool memory will rise over time so you cannot be sure the provided pool won't get dirty if open fails. It would be better to create a sub pool for shared memory which will ensure that both parent pool doesn't leak memory and that file is always closed. Repeating apr_file_close across all possible return failures just make no sense when we have pools. Regards -- ^TM
