Files not closed during error checking
Corrected commit
Signed-off-by: Brice DUBOST <mumudvb@braice.net>