[mapserver-commits] r10663 - in branches/branch-5-4/mapserver: . mapscript/java

svn at osgeo.org svn at osgeo.org
Sun Oct 24 12:16:03 EDT 2010


Author: tamas
Date: 2010-10-24 09:16:03 -0700 (Sun, 24 Oct 2010)
New Revision: 10663

Modified:
   branches/branch-5-4/mapserver/HISTORY.TXT
   branches/branch-5-4/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-4/mapserver/HISTORY.TXT
===================================================================
--- branches/branch-5-4/mapserver/HISTORY.TXT	2010-10-24 16:13:04 UTC (rev 10662)
+++ branches/branch-5-4/mapserver/HISTORY.TXT	2010-10-24 16:16:03 UTC (rev 10663)
@@ -13,6 +13,8 @@
 
 Current Version:
 ----------------
+- Fix for the memory corruption when mapping the string data type in the Java bindings (#3491)
+
 - Ensure the class is not marked BeforeFieldInit causing memory corruption with C#/CLR4 (#3438)
 
 - Fixed MSSQL2008 driver returning invalid extent (#3498)

Modified: branches/branch-5-4/mapserver/mapscript/java/javamodule.i
===================================================================
--- branches/branch-5-4/mapserver/mapscript/java/javamodule.i	2010-10-24 16:13:04 UTC (rev 10662)
+++ branches/branch-5-4/mapserver/mapscript/java/javamodule.i	2010-10-24 16:16:03 UTC (rev 10663)
@@ -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