diff options
author | Robert C. Helling <helling@atdotde.de> | 2018-08-31 13:46:34 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-08-31 06:34:44 -0700 |
commit | 554a7aaba4ad1a65a68a7d3e6f8aeece548351b9 (patch) | |
tree | 1424afc92e8bcf08e44790fb981edb296e07c034 | |
parent | 4e1f806d024e49f440723e4bf0a706ee2662e6dc (diff) | |
download | subsurface-554a7aaba4ad1a65a68a7d3e6f8aeece548351b9.tar.gz |
Zero initialize deco state struct
Valgrind found use of some uninitialized variable (probably
ds->gf_low_pressure_this_dive ), see #1614. Zero is the correct
value to start with. Lacking a working version of valgrind I cannot
check this actually fixes the problem.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
-rw-r--r-- | qt-models/diveplannermodel.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp index 32231ecca..b2d71d1ef 100644 --- a/qt-models/diveplannermodel.cpp +++ b/qt-models/diveplannermodel.cpp @@ -903,6 +903,7 @@ void DivePlannerPointsModel::createTemporaryPlan() struct deco_state plan_deco_state; struct diveplan *plan_copy; + memset(&plan_deco_state, 0, sizeof(struct deco_state)); plan(&plan_deco_state, &diveplan, &displayed_dive, DECOTIMESTEP, stoptable, &cache, isPlanner(), false); plan_copy = (struct diveplan *)malloc(sizeof(struct diveplan)); lock_planner(); |