[mapserver-commits] r10660 - in branches/branch-5-6/mapserver: . mapscript/java

svn at osgeo.org svn at osgeo.org
Sun Oct 24 12:07:46 EDT 2010


Author: tamas
Date: 2010-10-24 09:07:46 -0700 (Sun, 24 Oct 2010)
New Revision: 10660

Modified:
   branches/branch-5-6/mapserver/HISTORY.TXT
   branches/branch-5-6/mapserver/mapscript/java/javamodule.i
Log:
Fix for the memory corruption when mapping the string data type in the Java bindings (3491)

Modified: branches/branch-5-6/mapserver/HISTORY.TXT
===================================================================
--- branches/branch-5-6/mapserver/HISTORY.TXT	2010-10-24 15:20:39 UTC (rev 10659)
+++ branches/branch-5-6/mapserver/HISTORY.TXT	2010-10-24 16:07:46 UTC (rev 10660)
@@ -14,6 +14,8 @@
 Current Version
 ---------------
 
+- Fix for the memory corruption when mapping the string data type in the Java bindings (3491)
+
 - Correct wms 1.3.0 latlong bbox error (#2578)
 
 - Fix ProperyIsLike not used efficiently with Oracle (#3557) 

Modified: branches/branch-5-6/mapserver/mapscript/java/javamodule.i
===================================================================
--- branches/branch-5-6/mapserver/mapscript/java/javamodule.i	2010-10-24 15:20:39 UTC (rev 10659)
+++ branches/branch-5-6/mapserver/mapscript/java/javamodule.i	2010-10-24 16:07:46 UTC (rev 10660)
@@ -127,6 +127,11 @@
 	$1 = JNU_GetStringNativeChars(jenv, $input);
 }
 
+/* The default mapping would use ReleaseStringUTFChars to release the
+memory allocated with JNU_GetStringNativeChars which causes a
+memory corruption. (#3491) */
+%typemap(freearg, noblock=1) char * { if ($1) free($1); }
+
 %typemap(out) char * {
 	$result = JNU_NewStringNative(jenv, $1);
 }



More information about the mapserver-commits mailing list