summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2022-05-10 12:30:59 -0400
committerNat Goodspeed <nat@lindenlab.com>2022-05-10 12:30:59 -0400
commit5bed414ba9418ba8599d3b333eb30e63f62124ae (patch)
tree4123a176422debac4dde6f3bf5ec4df2555f07e9 /indra
parent4dddb17dfc0dc2c0bdd21263574707a91f2b00a9 (diff)
SL-17219: Fix bug: dangling pointer to destroyed std::string.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/lltexturefetch.cpp4
-rw-r--r--indra/newview/lltexturefetch.h2
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();