From 1935f795074e54ee298b0972657eba6e8f0c493f Mon Sep 17 00:00:00 2001 From: Ted John Date: Tue, 13 Dec 2016 21:48:27 +0000 Subject: [PATCH] Don't return pointer to local variable --- src/ride/TrackDesignRepository.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ride/TrackDesignRepository.cpp b/src/ride/TrackDesignRepository.cpp index a288154204..09ce52e2b3 100644 --- a/src/ride/TrackDesignRepository.cpp +++ b/src/ride/TrackDesignRepository.cpp @@ -176,7 +176,11 @@ public: item->Path = std::string(newPath); SortItems(); - result = newPath; + item = GetTrackItem(newPath); + if (item != nullptr) + { + result = item->Path.c_str(); + } } } }