From 710d47a2dad949e8d9a444887acd40f408db1dca Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 9 Jun 2016 17:19:05 -0700 Subject: Make sure dive computer model is proper malloc'ed allocation Reported-and-tested-by: Rick Walsh Signed-off-by: Linus Torvalds Signed-off-by: Dirk Hohndel --- desktop-widgets/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); -- cgit v1.2.3-70-g09d2