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>
This commit is contained in:
Robert C. Helling 2018-08-31 13:46:34 +02:00 committed by Dirk Hohndel
parent 4e1f806d02
commit 554a7aaba4

View file

@ -903,6 +903,7 @@ void DivePlannerPointsModel::createTemporaryPlan()
struct deco_state plan_deco_state; struct deco_state plan_deco_state;
struct diveplan *plan_copy; 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(&plan_deco_state, &diveplan, &displayed_dive, DECOTIMESTEP, stoptable, &cache, isPlanner(), false);
plan_copy = (struct diveplan *)malloc(sizeof(struct diveplan)); plan_copy = (struct diveplan *)malloc(sizeof(struct diveplan));
lock_planner(); lock_planner();