Skip to content

Commit

Permalink
Initialize status variable for cached WFS results (#5974)
Browse files Browse the repository at this point in the history
  • Loading branch information
geographika authored and rouault committed Jan 15, 2020
1 parent 69ef132 commit 006d4ba
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions mapogroutput.c
Expand Up @@ -892,7 +892,7 @@ int msOGRWriteFromQuery( mapObj *map, outputFormatObj *format, int sendheaders )
/* Process each layer with a resultset. */
/* ==================================================================== */
for( iLayer = 0; iLayer < map->numlayers; iLayer++ ) {
int status;
int status = 0;
layerObj *layer = GET_LAYER(map, iLayer);
shapeObj resultshape;
OGRLayerH hOGRLayer;
Expand Down Expand Up @@ -1103,20 +1103,21 @@ int msOGRWriteFromQuery( mapObj *map, outputFormatObj *format, int sendheaders )
if( layer->resultcache->results[i].shape )
{
/* msDebug("Using cached shape %ld\n", layer->resultcache->results[i].shapeindex); */
msCopyShape(layer->resultcache->results[i].shape, &resultshape);
status = msCopyShape(layer->resultcache->results[i].shape, &resultshape);
}
else
{
status = msLayerGetShape(layer, &resultshape, &(layer->resultcache->results[i]));
if(status != MS_SUCCESS) {
OGR_DS_Destroy( hDS );
msOGRCleanupDS( datasource_name );
msGMLFreeItems(item_list);
msFreeShape(&resultshape);
CSLDestroy(layer_options);
return status;
}
status = msLayerGetShape(layer, &resultshape, &(layer->resultcache->results[i]));
}

if(status != MS_SUCCESS) {
OGR_DS_Destroy( hDS );
msOGRCleanupDS( datasource_name );
msGMLFreeItems(item_list);
msFreeShape(&resultshape);
CSLDestroy(layer_options);
return status;
}

/*
** Perform classification, and some annotation related magic.
Expand Down

0 comments on commit 006d4ba

Please sign in to comment.