Skip to content

Commit

Permalink
PostGIS: call msLayerTranslateFilter() in msPostGISLayerGetShapeCount…
Browse files Browse the repository at this point in the history
…(), and fix memory leaks in msPostGISBuildSQLWhere()
  • Loading branch information
rouault committed Feb 10, 2016
1 parent 2514786 commit 4557afe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mappostgis.c
Original file line number Diff line number Diff line change
Expand Up @@ -2079,6 +2079,7 @@ char *msPostGISBuildSQLWhere(layerObj *layer, rectObj *rect, long *uid, rectObj
strTmp = msStringConcatenate(strTmp, ")");

msFree(strRect);
msFree(strRectOtherSRID);
strRect = strTmp;
strRectLength = strlen(strRect);
}
Expand Down Expand Up @@ -2117,6 +2118,7 @@ char *msPostGISBuildSQLWhere(layerObj *layer, rectObj *rect, long *uid, rectObj
strTmp = msStringConcatenate(strTmp, ")");

msFree(strRect);
msFree(strRectOtherSRID);
strRect = strTmp;
strRectLength = strlen(strRect);
}
Expand Down Expand Up @@ -2933,6 +2935,8 @@ int msPostGISLayerGetShapeCount(layerObj *layer, rectObj rect, projectionObj *re
}
#endif

msLayerTranslateFilter(layer, &layer->filter, layer->filteritem);

/* Fill out layerinfo with our current DATA state. */
if ( msPostGISParseData(layer) != MS_SUCCESS) {
return -1;
Expand Down

0 comments on commit 4557afe

Please sign in to comment.