@@ -895,7 +895,7 @@ int msOGRWriteFromQuery( mapObj *map, outputFormatObj *format, int sendheaders )
895
895
/* Process each layer with a resultset. */
896
896
/* ==================================================================== */
897
897
for ( iLayer = 0 ; iLayer < map -> numlayers ; iLayer ++ ) {
898
- int status ;
898
+ int status = 0 ;
899
899
layerObj * layer = GET_LAYER (map , iLayer );
900
900
shapeObj resultshape ;
901
901
OGRLayerH hOGRLayer ;
@@ -1106,20 +1106,21 @@ int msOGRWriteFromQuery( mapObj *map, outputFormatObj *format, int sendheaders )
1106
1106
if ( layer -> resultcache -> results [i ].shape )
1107
1107
{
1108
1108
/* msDebug("Using cached shape %ld\n", layer->resultcache->results[i].shapeindex); */
1109
- msCopyShape (layer -> resultcache -> results [i ].shape , & resultshape );
1109
+ status = msCopyShape (layer -> resultcache -> results [i ].shape , & resultshape );
1110
1110
}
1111
1111
else
1112
1112
{
1113
- status = msLayerGetShape (layer , & resultshape , & (layer -> resultcache -> results [i ]));
1114
- if (status != MS_SUCCESS ) {
1115
- OGR_DS_Destroy ( hDS );
1116
- msOGRCleanupDS ( datasource_name );
1117
- msGMLFreeItems (item_list );
1118
- msFreeShape (& resultshape );
1119
- CSLDestroy (layer_options );
1120
- return status ;
1121
- }
1113
+ status = msLayerGetShape (layer , & resultshape , & (layer -> resultcache -> results [i ]));
1122
1114
}
1115
+
1116
+ if (status != MS_SUCCESS ) {
1117
+ OGR_DS_Destroy ( hDS );
1118
+ msOGRCleanupDS ( datasource_name );
1119
+ msGMLFreeItems (item_list );
1120
+ msFreeShape (& resultshape );
1121
+ CSLDestroy (layer_options );
1122
+ return status ;
1123
+ }
1123
1124
1124
1125
/*
1125
1126
** Perform classification, and some annotation related magic.
0 commit comments