Make sure dive computer model is proper malloc'ed allocation

Reported-and-tested-by: Rick Walsh <rickmwalsh@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Linus Torvalds 2016-06-09 17:19:05 -07:00 committed by Dirk Hohndel
parent 3870916ae2
commit 710d47a2da

View file

@ -890,7 +890,7 @@ void MainWindow::setupForAddAndPlan(const char *model)
clear_dive_site(&displayed_dive_site);
displayed_dive.id = dive_getUniqID(&displayed_dive);
displayed_dive.when = QDateTime::currentMSecsSinceEpoch() / 1000L + gettimezoneoffset() + 3600;
displayed_dive.dc.model = model; // don't translate! this is stored in the XML file
displayed_dive.dc.model = strdup(model); // don't translate! this is stored in the XML file
// setup the dive cylinders
DivePlannerPointsModel::instance()->clear();
DivePlannerPointsModel::instance()->setupCylinders();