diff options
author | Martijn Coenen <maco@google.com> | 2020-11-26 12:12:45 +0100 |
---|---|---|
committer | Martijn Coenen <maco@google.com> | 2020-11-26 13:13:53 +0000 |
commit | 2d5e05b44248e445af986ca8410c6e98c6ba3533 (patch) | |
tree | a21d341aaf131120c9f9786fc9ce2a1d0a3745fd | |
parent | e1a4104933b949e682f924db01b51cf5aef74469 (diff) | |
download | native-2d5e05b44248e445af986ca8410c6e98c6ba3533.tar.gz |
Don't return a reference in FindQuotaDeviceForUuid.
Since the object could be destroyed after we return it.
Bug: 169421939
Test: N/A
Change-Id: Ib2f68f87b5e04d59f825b2b1f48de39ca007452f
-rw-r--r-- | cmds/installd/QuotaUtils.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmds/installd/QuotaUtils.cpp b/cmds/installd/QuotaUtils.cpp index e0802911ca..60271392e9 100644 --- a/cmds/installd/QuotaUtils.cpp +++ b/cmds/installd/QuotaUtils.cpp @@ -35,7 +35,7 @@ std::recursive_mutex mMountsLock; /* Map of all quota mounts from target to source */ std::unordered_map<std::string, std::string> mQuotaReverseMounts; -std::string& FindQuotaDeviceForUuid(const std::string& uuid) { +std::string FindQuotaDeviceForUuid(const std::string& uuid) { std::lock_guard<std::recursive_mutex> lock(mMountsLock); auto path = create_data_path(uuid.empty() ? nullptr : uuid.c_str()); return mQuotaReverseMounts[path]; |