[mapserver-commits] r13197 - trunk/mapserver/mapcache/lib
svn at osgeo.org
svn at osgeo.org
Fri Mar 2 09:58:14 EST 2012
Author: hobu
Date: 2012-03-02 06:58:14 -0800 (Fri, 02 Mar 2012)
New Revision: 13197
Modified:
trunk/mapserver/mapcache/lib/source_mapserver.c
Log:
clean up patch for #4219 -- no need to copy strings around
Modified: trunk/mapserver/mapcache/lib/source_mapserver.c
===================================================================
--- trunk/mapserver/mapcache/lib/source_mapserver.c 2012-03-02 14:53:23 UTC (rev 13196)
+++ trunk/mapserver/mapcache/lib/source_mapserver.c 2012-03-02 14:58:14 UTC (rev 13197)
@@ -52,22 +52,14 @@
if(!origmap) {
msWriteError(stderr);
errors = msGetErrorObj();
- char* msg = (char*) msSmallMalloc(MESSAGELENGTH+1);
- msg = msStrdup(errors->message);
-
- ctx->set_error(ctx,500,"Failed to load mapfile '%s'. Mapserver reports: ",mapserver->mapfile, msg);
- msFree(msg);
+ ctx->set_error(ctx,500,"Failed to load mapfile '%s'. Mapserver reports: ",mapserver->mapfile, errors->message);
return;
}
mapObj *omap = msNewMapObj();
msCopyMap(omap,origmap);
if (msLoadProjectionString(&(omap->projection), map->grid_link->grid->srs) != 0) {
errors = msGetErrorObj();
- char* msg = (char*) msSmallMalloc(MESSAGELENGTH+1);
- msg = msStrdup(errors->message);
-
- ctx->set_error(ctx,500, "Unable to set projection on mapObj. MapServer reports: %s", msg);
- msFree(msg);
+ ctx->set_error(ctx,500, "Unable to set projection on mapObj. MapServer reports: %s", errors->message);
return;
}
switch(map->grid_link->grid->unit) {
@@ -101,11 +93,7 @@
imageObj *image = msDrawMap(omap, MS_FALSE);
if(!image) {
errors = msGetErrorObj();
- char* msg = (char*) msSmallMalloc(MESSAGELENGTH+1);
- msg = msStrdup(errors->message);
-
- ctx->set_error(ctx,500, "MapServer failed to create image. MapServer reports: %s", msg);
- msFree(msg);
+ ctx->set_error(ctx,500, "MapServer failed to create image. MapServer reports: %s", errors->message);
msFreeMap(omap);
return;
}
More information about the mapserver-commits
mailing list