Fix potential null pointer dereference

If createTemporaryPlan was called on a empty diveplan.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Anton Lundin 2013-12-11 00:53:37 +01:00 committed by Dirk Hohndel
parent 0812d2def2
commit 82b86fe924

View file

@ -1422,6 +1422,8 @@ void DivePlannerPointsModel::createTemporaryPlan()
lastIndex = i;
plan_add_segment(&diveplan, deltaT, p.depth, p.o2, p.he, p.po2);
}
if (!diveplan.dp)
return;
char *cache = NULL;
tempDive = NULL;
const char *errorString = NULL;