[Scummvm-cvs-logs] SF.net SVN: scummvm:[52413] scummvm/trunk/engines/sci/engine/kpathing.cpp

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Fri Aug 27 19:26:35 CEST 2010


Revision: 52413
          http://scummvm.svn.sourceforge.net/scummvm/?rev=52413&view=rev
Author:   eriktorbjorn
Date:     2010-08-27 17:26:34 +0000 (Fri, 27 Aug 2010)

Log Message:
-----------
SCI: Fixed potential memory leak in convert_polygon()

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kpathing.cpp

Modified: scummvm/trunk/engines/sci/engine/kpathing.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kpathing.cpp	2010-08-27 15:09:54 UTC (rev 52412)
+++ scummvm/trunk/engines/sci/engine/kpathing.cpp	2010-08-27 17:26:34 UTC (rev 52413)
@@ -1098,8 +1098,6 @@
 		return NULL;
 	}
 
-	Polygon *poly = new Polygon(readSelectorValue(segMan, polygon, SELECTOR(type)));
-
 	SegmentRef pointList = segMan->dereference(points);
 	// Check if the target polygon is still valid. It may have been released
 	// in the meantime (e.g. in LSL6, room 700, when using the elevator).
@@ -1129,6 +1127,8 @@
 		}
 	}
 
+	Polygon *poly = new Polygon(readSelectorValue(segMan, polygon, SELECTOR(type)));
+
 	for (i = skip; i < size; i++) {
 		Vertex *vertex = new Vertex(readPoint(pointList, i));
 		poly->vertices.insertHead(vertex);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list