Skip to content
Permalink
Browse files
Initialize status variable for cached WFS results (#5974)
  • Loading branch information
geographika authored and rouault committed Jan 15, 2020
1 parent 40818d4 commit 9f6b5ba985acd5621c51ba8a52e1a094bd0e5722
Showing 1 changed file with 12 additions and 11 deletions.
@@ -895,7 +895,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;
@@ -1106,20 +1106,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.

0 comments on commit 9f6b5ba

Please sign in to comment.