diff options
Diffstat (limited to 'core/subsurface-qt/DiveObjectHelper.cpp')
-rw-r--r-- | core/subsurface-qt/DiveObjectHelper.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/subsurface-qt/DiveObjectHelper.cpp b/core/subsurface-qt/DiveObjectHelper.cpp index 0742e382f..921d55bea 100644 --- a/core/subsurface-qt/DiveObjectHelper.cpp +++ b/core/subsurface-qt/DiveObjectHelper.cpp @@ -112,7 +112,12 @@ QString DiveObjectHelper::location() const QString DiveObjectHelper::gps() const { struct dive_site *ds = m_dive->dive_site; - return ds ? QString(printGPSCoords(&ds->location)) : QString(); + if (!ds) + return QString(); + char *gps = printGPSCoords(&ds->location); + QString res = gps; + free(gps); + return res; } QString DiveObjectHelper::gps_decimal() const |