[mapserver-commits] r11462 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Tue Apr 5 10:08:53 EDT 2011


Author: assefa
Date: 2011-04-05 07:08:53 -0700 (Tue, 05 Apr 2011)
New Revision: 11462

Modified:
   trunk/mapserver/mapogcfiltercommon.c
Log:
use msSmallMalloc (#3807)

Modified: trunk/mapserver/mapogcfiltercommon.c
===================================================================
--- trunk/mapserver/mapogcfiltercommon.c	2011-04-05 13:01:09 UTC (rev 11461)
+++ trunk/mapserver/mapogcfiltercommon.c	2011-04-05 14:08:53 UTC (rev 11462)
@@ -524,7 +524,7 @@
         if (pszEPSG)
           psNode->pszSRS = msStrdup(pszEPSG);
         
-        psTmpShape = (shapeObj *)malloc(sizeof(shapeObj));
+        psTmpShape = (shapeObj *)msSmallMalloc(sizeof(shapeObj));
         msInitShape(psTmpShape);
         msRectToPolygon(sQueryRect, psTmpShape);
         bBBoxQuery = 1;
@@ -642,13 +642,13 @@
                     if (bString)
                     {   
                         bufferSize = 11+strlen(tokens[i])+strlen(pszAttribute)+1;
-                        pszTmp = (char *)malloc(bufferSize);
+                        pszTmp = (char *)msSmallMalloc(bufferSize);
                         snprintf(pszTmp, bufferSize, "(\"[%s]\" ==\"%s\")" , pszAttribute, tokens[i]);
                     }
                     else
                     {   
                         bufferSize = 8+strlen(tokens[i])+strlen(pszAttribute)+1;
-                        pszTmp = (char *)malloc(bufferSize);
+                        pszTmp = (char *)msSmallMalloc(bufferSize);
                         snprintf(pszTmp, bufferSize, "([%s] == %s)" , pszAttribute, tokens[i]);
                     }
 
@@ -715,7 +715,7 @@
     
     map->query.type = MS_QUERY_BY_FILTER;
 
-    map->query.filter = (expressionObj *) malloc(sizeof(expressionObj));
+    map->query.filter = (expressionObj *) msSmallMalloc(sizeof(expressionObj));
     initExpression( map->query.filter);
     map->query.filter->string = msStrdup(pszExpression);
     map->query.filter->type = 2000;



More information about the mapserver-commits mailing list