<!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> </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> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Index:
/ogr/ogrsf_frmts/mitab/mitab_feature.cpp<BR>===================================================================<BR>---
/ogr/ogrsf_frmts/mitab/mitab_feature.cpp (revision 1172<SPAN
class=546492001-09072007>9</SPAN>)<BR>+++
/ogr/ogrsf_frmts/mitab/mitab_feature.cpp (working copy)<BR>@@ -7813,6
+7813,12 @@<BR>
}<BR> }<BR> <BR>+ if
(poStyleMgr)<BR>+ delete poStyleMgr;<BR>+<BR>+ if
(poStylePart)<BR>+ delete
poStylePart;<BR>+<BR> return;<BR> }<BR> <BR>@@
-7997,7 +8003,13 @@<BR>
SetBrushFGColor((GInt32)nBrushColor);<BR>
}<BR> <BR>- return;<BR>+ if
(poStyleMgr)<BR>+ delete poStyleMgr;<BR>+<BR>+ if
(poStylePart)<BR>+ delete poStylePart;<BR>+<BR>+
return;<BR> <BR> } <BR> <BR>@@ -8281,6
+8293,14 @@<BR> nSymbolColor =
strtol(pszSymbolColor, NULL,
16);<BR>
SetSymbolColor((GInt32)nSymbolColor);<BR>
}<BR>+<BR>+ if (poStyleMgr)<BR>+ {<BR>+ delete
poStyleMgr;<BR>+ }<BR>+<BR>+ if (poStylePart)<BR>+ delete
poStylePart;<BR> <BR>
return;<BR> <BR> <BR>Index:
/ogr/ogrsf_frmts/mitab/mitab_imapinfofile.cpp<BR>===================================================================<BR>---
/ogr/ogrsf_frmts/mitab/mitab_imapinfofile.cpp (revision 11728)<BR>+++
/ogr/ogrsf_frmts/mitab/mitab_imapinfofile.cpp (working copy)<BR>@@ -281,6
+281,7 @@<BR> TABPoint *poTABPointFeature =
NULL;<BR> TABRegion *poTABRegionFeature =
NULL;<BR> TABPolyline *poTABPolylineFeature =
NULL;<BR>+ const char *styleString =
NULL;<BR> <BR>
/*-----------------------------------------------------------------<BR>
* MITAB won't accept new features unless they are in a type derived<BR>@@
-300,11 +301,11 @@<BR>
*------------------------------------------------------------*/<BR>
case wkbPoint:<BR> poTABFeature
= new
TABPoint(poFeature->GetDefnRef());<BR>-
if(poFeature->GetStyleString())<BR>+ styleString =
poFeature->GetStyleString();<BR>+
if(styleString)<BR>
{<BR>
poTABPointFeature =
(TABPoint*)poTABFeature;<BR>-
poTABPointFeature->SetSymbolFromStyleString(<BR>-
poFeature->GetStyleString());<BR>+
poTABPointFeature->SetSymbolFromStyleString(styleString);<BR>
}<BR>
break;<BR>
/*-------------------------------------------------------------<BR>@@ -313,14
+314,13 @@<BR> case
wkbPolygon:<BR> case
wkbMultiPolygon:<BR>
poTABFeature = new
TABRegion(poFeature->GetDefnRef());<BR>-
if(poFeature->GetStyleString())<BR>+ styleString =
poFeature->GetStyleString();<BR>+
if(styleString)<BR>
{<BR>
poTABRegionFeature =
(TABRegion*)poTABFeature;<BR>-
poTABRegionFeature->SetPenFromStyleString(<BR>-
poFeature->GetStyleString());<BR>+
poTABRegionFeature->SetPenFromStyleString(styleString);<BR> <BR>-
poTABRegionFeature->SetBrushFromStyleString(<BR>-
poFeature->GetStyleString());<BR>+
poTABRegionFeature->SetBrushFromStyleString(styleString);<BR>
}<BR>
break;<BR>
/*-------------------------------------------------------------<BR>@@ -329,11
+329,11 @@<BR> case
wkbLineString:<BR> case
wkbMultiLineString:<BR>
poTABFeature = new
TABPolyline(poFeature->GetDefnRef());<BR>-
if(poFeature->GetStyleString())<BR>+ styleString =
poFeature->GetStyleString();<BR>+
if(styleString)<BR>
{<BR>
poTABPolylineFeature =
(TABPolyline*)poTABFeature;<BR>-
poTABPolylineFeature->SetPenFromStyleString(<BR>-
poFeature->GetStyleString());<BR>+
poTABPolylineFeature->SetPenFromStyleString(styleString);<BR>
}<BR>
break;<BR>
/*-------------------------------------------------------------<BR>@@ -381,6
+381,8 @@<BR> eErr =
OGRERR_FAILURE;<BR> <BR> delete
poTABFeature;<BR>+ if (styleString != NULL)<BR>+ CPLFree((void
*)styleString);<BR> <BR> return
eErr;<BR> }<BR></FONT></DIV></BODY></HTML>