Ticket #598 (closed defect: fixed)

Opened 9 years ago

Last modified 9 years ago

GXFOpen let the file opened when fails

Reported by: dem@… Owned by: warmerdam
Priority: high Milestone:
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords:
Cc:

Description

in gdal/frmts/gxf/gxfopen.c

if GXFOpen fails the function returns directly without close the opened file in
binary mode "fp" :

/* -------------------------------------------------------------------- */
/*      Did we find the #GRID?                                          */
/* -------------------------------------------------------------------- */
    if( !EQUALN(szTitle,"#GRID",5) )
    {
        CPLError( CE_Failure, CPLE_WrongFormat,
                  "Didn't parse through to #GRID successfully in.\n"
                  "file `%s'.\n",
                  pszFilename );
        
        return NULL;
    }

Maybe just add a GXFClose before the return solve the problem...

Julien

Change History

Changed 9 years ago by warmerdam

Problem and fix confirmed and applied. 

Note: See TracTickets for help on using tickets.