summaryrefslogtreecommitdiffstats
path: root/generic/tkbltGrMarkerLine.C
diff options
context:
space:
mode:
authorAdrián Medraño Calvo <adrian@medranocalvo.com>2017-07-27 15:52:01 (GMT)
committerAdrián Medraño Calvo <adrian@medranocalvo.com>2017-07-27 15:52:01 (GMT)
commite8635888a9d67eff399ad5d5fdded50dcc7e843a (patch)
treec3e67122662a5da2875dcb50d74b1e27abbfadbc /generic/tkbltGrMarkerLine.C
parent796f2e815904da90bf1d801493f34f4127848eaa (diff)
downloadblt-e8635888a9d67eff399ad5d5fdded50dcc7e843a.zip
blt-e8635888a9d67eff399ad5d5fdded50dcc7e843a.tar.gz
blt-e8635888a9d67eff399ad5d5fdded50dcc7e843a.tar.bz2
Prevent dangling pointer
The freed pointer would dangle as a result of the early exit, causing a double-free upon next Blt::LineMarker::map invocation.
Diffstat (limited to 'generic/tkbltGrMarkerLine.C')
-rw-r--r--generic/tkbltGrMarkerLine.C4
1 files changed, 3 insertions, 1 deletions
diff --git a/generic/tkbltGrMarkerLine.C b/generic/tkbltGrMarkerLine.C
index 30ef70e..954d4dc 100644
--- a/generic/tkbltGrMarkerLine.C
+++ b/generic/tkbltGrMarkerLine.C
@@ -152,8 +152,10 @@ void LineMarker::map()
LineMarkerOptions* ops = (LineMarkerOptions*)ops_;
nSegments_ = 0;
- if (segments_)
+ if (segments_) {
delete [] segments_;
+ segments_ = NULL;
+ }
if (!ops->worldPts || (ops->worldPts->num < 2))
return;