diff options
author | Torbjörn Andersson | 2010-08-27 17:26:34 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2010-08-27 17:26:34 +0000 |
commit | b442ee701046ecbad9ff210ab9b9463f6a9fcce4 (patch) | |
tree | 78b647a8f06702806aa7718660f55db692b50aa7 | |
parent | b5b4ecbed6428f9a96900b084239e274ae1cdf4b (diff) | |
download | scummvm-rg350-b442ee701046ecbad9ff210ab9b9463f6a9fcce4.tar.gz scummvm-rg350-b442ee701046ecbad9ff210ab9b9463f6a9fcce4.tar.bz2 scummvm-rg350-b442ee701046ecbad9ff210ab9b9463f6a9fcce4.zip |
SCI: Fixed potential memory leak in convert_polygon()
svn-id: r52413
-rw-r--r-- | engines/sci/engine/kpathing.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp index 9c5973939e..faf966af92 100644 --- a/engines/sci/engine/kpathing.cpp +++ b/engines/sci/engine/kpathing.cpp @@ -1098,8 +1098,6 @@ static Polygon *convert_polygon(EngineState *s, reg_t polygon) { 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 @@ static Polygon *convert_polygon(EngineState *s, reg_t polygon) { } } + 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); |