fix potential use-after-frees of stack memory
`devname_value` is a local variable; if `property_get` succeeds, we'll
return a pointer to it. Returning a `std::string` instead sidesteps this
problem.
Bug: 190757198
Test: TreeHugger
Change-Id: If9ca733dd21128706f2a9f62e8460b1286631aa5
diff --git a/gnss/common/utils/default/include/GnssReplayUtils.h b/gnss/common/utils/default/include/GnssReplayUtils.h
index d7530f7..32c0e58 100644
--- a/gnss/common/utils/default/include/GnssReplayUtils.h
+++ b/gnss/common/utils/default/include/GnssReplayUtils.h
@@ -35,7 +35,7 @@
namespace common {
struct ReplayUtils {
- static const char* getGnssPath();
+ static std::string getGnssPath();
static std::string getDataFromDeviceFile(const std::string& command, int mMinIntervalMs);