diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2022-05-10 12:30:59 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2022-05-10 12:30:59 -0400 |
commit | 5bed414ba9418ba8599d3b333eb30e63f62124ae (patch) | |
tree | 4123a176422debac4dde6f3bf5ec4df2555f07e9 /indra | |
parent | 4dddb17dfc0dc2c0bdd21263574707a91f2b00a9 (diff) |
SL-17219: Fix bug: dangling pointer to destroyed std::string.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/lltexturefetch.cpp | 4 | ||||
-rw-r--r-- | indra/newview/lltexturefetch.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 8ad28074de..f30e640f80 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -2540,11 +2540,11 @@ void LLTextureFetchWorker::recordTextureDone(bool is_http, F64 byte_count) ////////////////////////////////////////////////////////////////////////////// // public -const char* LLTextureFetch::getStateString(S32 state) +std::string LLTextureFetch::getStateString(S32 state) { if (state < 0 || state > sizeof(e_state_name) / sizeof(char*)) { - return llformat("%d", state).c_str(); + return llformat("%d", state); } return e_state_name[state]; diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index 0cf9775af2..ff6bb8b505 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -59,7 +59,7 @@ class LLTextureFetch : public LLWorkerThread friend class LLTextureFetchWorker; public: - static const char* getStateString(S32 state); + static std::string getStateString(S32 state); LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* imagedecodethread, bool threaded, bool qa_mode); ~LLTextureFetch(); |