<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16481" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN class=546492001-09072007>I've fixed a few 
memory leaks in the MITAB driver that have been plaguing me lately. Hopefully 
someone more qualified than I can validate these changes and submit them into 
the code base.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=546492001-09072007></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=546492001-09072007>Regards,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=546492001-09072007>Richard</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN 
class=546492001-09072007></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Index: 
/ogr/ogrsf_frmts/mitab/mitab_feature.cpp<BR>===================================================================<BR>--- 
/ogr/ogrsf_frmts/mitab/mitab_feature.cpp&nbsp;(revision 1172<SPAN 
class=546492001-09072007>9</SPAN>)<BR>+++ 
/ogr/ogrsf_frmts/mitab/mitab_feature.cpp&nbsp;(working copy)<BR>@@ -7813,6 
+7813,12 @@<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;<BR>+&nbsp;if 
(poStyleMgr)<BR>+&nbsp;&nbsp;delete poStyleMgr;<BR>+<BR>+&nbsp;if 
(poStylePart)<BR>+&nbsp;&nbsp;delete 
poStylePart;<BR>+<BR>&nbsp;&nbsp;&nbsp;&nbsp; return;<BR>&nbsp;}<BR>&nbsp;<BR>@@ 
-7997,7 +8003,13 @@<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
SetBrushFGColor((GInt32)nBrushColor);<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;<BR>-&nbsp;&nbsp;&nbsp;&nbsp; return;<BR>+&nbsp;if 
(poStyleMgr)<BR>+&nbsp;&nbsp;delete poStyleMgr;<BR>+<BR>+&nbsp;if 
(poStylePart)<BR>+&nbsp;&nbsp;delete poStylePart;<BR>+<BR>+&nbsp;&nbsp;&nbsp; 
return;<BR>&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;}&nbsp; <BR>&nbsp;<BR>@@ -8281,6 
+8293,14 @@<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nSymbolColor = 
strtol(pszSymbolColor, NULL, 
16);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
SetSymbolColor((GInt32)nSymbolColor);<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>+<BR>+&nbsp;if (poStyleMgr)<BR>+&nbsp;{<BR>+&nbsp;&nbsp;delete 
poStyleMgr;<BR>+&nbsp;}<BR>+<BR>+&nbsp;if (poStylePart)<BR>+&nbsp;&nbsp;delete 
poStylePart;<BR>&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp; 
return;<BR>&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp; <BR>Index: 
/ogr/ogrsf_frmts/mitab/mitab_imapinfofile.cpp<BR>===================================================================<BR>--- 
/ogr/ogrsf_frmts/mitab/mitab_imapinfofile.cpp&nbsp;(revision 11728)<BR>+++ 
/ogr/ogrsf_frmts/mitab/mitab_imapinfofile.cpp&nbsp;(working copy)<BR>@@ -281,6 
+281,7 @@<BR>&nbsp;&nbsp;&nbsp;&nbsp; TABPoint *poTABPointFeature = 
NULL;<BR>&nbsp;&nbsp;&nbsp;&nbsp; TABRegion *poTABRegionFeature = 
NULL;<BR>&nbsp;&nbsp;&nbsp;&nbsp; TABPolyline *poTABPolylineFeature = 
NULL;<BR>+&nbsp;const char *styleString = 
NULL;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
/*-----------------------------------------------------------------<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
* MITAB won't accept new features unless they are in a type derived<BR>@@ 
-300,11 +301,11 @@<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
*------------------------------------------------------------*/<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
case wkbPoint:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; poTABFeature 
= new 
TABPoint(poFeature-&gt;GetDefnRef());<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
if(poFeature-&gt;GetStyleString())<BR>+&nbsp;&nbsp;styleString = 
poFeature-&gt;GetStyleString();<BR>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
if(styleString)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
poTABPointFeature = 
(TABPoint*)poTABFeature;<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
poTABPointFeature-&gt;SetSymbolFromStyleString(<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
poFeature-&gt;GetStyleString());<BR>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
poTABPointFeature-&gt;SetSymbolFromStyleString(styleString);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
/*-------------------------------------------------------------<BR>@@ -313,14 
+314,13 @@<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case 
wkbPolygon:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case 
wkbMultiPolygon:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
poTABFeature = new 
TABRegion(poFeature-&gt;GetDefnRef());<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
if(poFeature-&gt;GetStyleString())<BR>+&nbsp;&nbsp;styleString = 
poFeature-&gt;GetStyleString();<BR>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
if(styleString)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
poTABRegionFeature = 
(TABRegion*)poTABFeature;<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
poTABRegionFeature-&gt;SetPenFromStyleString(<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
poFeature-&gt;GetStyleString());<BR>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
poTABRegionFeature-&gt;SetPenFromStyleString(styleString);<BR>&nbsp;<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
poTABRegionFeature-&gt;SetBrushFromStyleString(<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
poFeature-&gt;GetStyleString());<BR>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
poTABRegionFeature-&gt;SetBrushFromStyleString(styleString);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
/*-------------------------------------------------------------<BR>@@ -329,11 
+329,11 @@<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case 
wkbLineString:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case 
wkbMultiLineString:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
poTABFeature = new 
TABPolyline(poFeature-&gt;GetDefnRef());<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
if(poFeature-&gt;GetStyleString())<BR>+&nbsp;&nbsp;styleString = 
poFeature-&gt;GetStyleString();<BR>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
if(styleString)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
poTABPolylineFeature = 
(TABPolyline*)poTABFeature;<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
poTABPolylineFeature-&gt;SetPenFromStyleString(<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
poFeature-&gt;GetStyleString());<BR>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
poTABPolylineFeature-&gt;SetPenFromStyleString(styleString);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
/*-------------------------------------------------------------<BR>@@ -381,6 
+381,8 @@<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; eErr = 
OGRERR_FAILURE;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp; delete 
poTABFeature;<BR>+&nbsp;if (styleString != NULL)<BR>+&nbsp;&nbsp;CPLFree((void 
*)styleString);<BR>&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp; return 
eErr;<BR>&nbsp;}<BR></FONT></DIV></BODY></HTML>