[mapserver-commits] r8499 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Wed Feb 4 20:04:27 EST 2009
Author: aboudreault
Date: 2009-02-04 20:04:26 -0500 (Wed, 04 Feb 2009)
New Revision: 8499
Modified:
trunk/mapserver/mapwms.c
Log:
small fix to be ANSI C compatible (#2871)
Modified: trunk/mapserver/mapwms.c
===================================================================
--- trunk/mapserver/mapwms.c 2009-02-04 20:39:36 UTC (rev 8498)
+++ trunk/mapserver/mapwms.c 2009-02-05 01:04:26 UTC (rev 8499)
@@ -414,8 +414,14 @@
if (strcasecmp(names[i], "LAYERS") == 0)
{
- int j, k, iLayer;
- int *layerOrder = (int*)malloc(map->numlayers * sizeof(int));
+ int j, k, iLayer, *layerOrder;
+
+ layerOrder = (int*)malloc(map->numlayers * sizeof(int));
+ if (layerOrder == NULL)
+ {
+ msSetError(MS_MEMERR, NULL, "msWMSLoadGetMapParams()");
+ return MS_FAILURE;
+ }
layers = msStringSplit(values[i], ',', &numlayers);
if (layers==NULL || strlen(values[i]) <=0 || numlayers < 1) {
More information about the mapserver-commits
mailing list