diff options
author | Adrián Medraño Calvo <adrian@medranocalvo.com> | 2017-07-27 15:52:01 (GMT) |
---|---|---|
committer | Adrián Medraño Calvo <adrian@medranocalvo.com> | 2017-07-27 15:52:01 (GMT) |
commit | e8635888a9d67eff399ad5d5fdded50dcc7e843a (patch) | |
tree | c3e67122662a5da2875dcb50d74b1e27abbfadbc /generic/tkbltGrMarkerLine.C | |
parent | 796f2e815904da90bf1d801493f34f4127848eaa (diff) | |
download | blt-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.C | 4 |
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; |