summaryrefslogtreecommitdiffstats
path: root/mobile-widgets
diff options
context:
space:
mode:
Diffstat (limited to 'mobile-widgets')
-rw-r--r--mobile-widgets/qmlmanager.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp
index 8973aef43..d9da5e562 100644
--- a/mobile-widgets/qmlmanager.cpp
+++ b/mobile-widgets/qmlmanager.cpp
@@ -1602,9 +1602,12 @@ QString QMLManager::getGpsFromSiteName(const QString& siteName)
struct dive_site *ds;
ds = get_dive_site_by_name(qPrintable(siteName));
- if (ds)
- return QString(printGPSCoords(&ds->location));
- return QString();
+ if (!ds)
+ return QString();
+ char *gps = printGPSCoords(&ds->location);
+ QString res = gps;
+ free(gps);
+ return res;
}
void QMLManager::setNotificationText(QString text)