fixed memory leak if a file couldn't get opened
Authored by: heiko 2013-03-18
Parent: [r914]
Child: [r916]