Return upon error, otherwise invalid file reference is used
Return upon error, otherwise invalid file reference is used

Found by clang analyzer

Change-Id: I5c6410f15aa5808bfe7c87031c72f60c8ccd8f4d

gram526/VTK,gram526/VTK,candy7393/VTK,SimVascular/VTK,sankhesh/VTK,sankhesh/VTK,SimVascular/VTK,keithroe/vtkoptix,jmerkow/VTK,gram526/VTK,demarle/VTK,SimVascular/VTK,demarle/VTK,mspark93/VTK,jmerkow/VTK,msmolens/VTK,msmolens/VTK,sankhesh/VTK,keithroe/vtkoptix,gram526/VTK,keithroe/vtkoptix,mspark93/VTK,SimVascular/VTK,sankhesh/VTK,candy7393/VTK,keithroe/vtkoptix,sumedhasingla/VTK,sankhesh/VTK,gram526/VTK,mspark93/VTK,SimVascular/VTK,candy7393/VTK,candy7393/VTK,jmerkow/VTK,candy7393/VTK,keithroe/vtkoptix,jmerkow/VTK,sumedhasingla/VTK,sumedhasingla/VTK,gram526/VTK,sumedhasingla/VTK,jmerkow/VTK,msmolens/VTK,msmolens/VTK,candy7393/VTK,sumedhasingla/VTK,demarle/VTK,SimVascular/VTK,gram526/VTK,mspark93/VTK,keithroe/vtkoptix,gram526/VTK,msmolens/VTK,sumedhasingla/VTK,demarle/VTK,sankhesh/VTK,jmerkow/VTK,demarle/VTK,SimVascular/VTK,keithroe/vtkoptix,demarle/VTK,keithroe/vtkoptix,mspark93/VTK,mspark93/VTK,msmolens/VTK,msmolens/VTK,jmerkow/VTK,sankhesh/VTK,demarle/VTK,mspark93/VTK,sankhesh/VTK,candy7393/VTK,demarle/VTK,mspark93/VTK,candy7393/VTK,sumedhasingla/VTK,sumedhasingla/VTK,msmolens/VTK,SimVascular/VTK,jmerkow/VTK