summaryrefslogtreecommitdiffstats
path: root/desktop-widgets
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2016-06-09 17:19:05 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-06-11 10:29:31 -0700
commit710d47a2dad949e8d9a444887acd40f408db1dca (patch)
treeecb95487f871255de03808627def962744fa0f6b /desktop-widgets
parent3870916ae24cb3e5531792c3a7c990a11913fee7 (diff)
downloadsubsurface-710d47a2dad949e8d9a444887acd40f408db1dca.tar.gz
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>
Diffstat (limited to 'desktop-widgets')
-rw-r--r--desktop-widgets/mainwindow.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index 6542a3ead..15f34e616 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -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();