From a4ca835593f402897dd97de7fc9f2bc26de09851 Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Sun, 20 Dec 2020 20:32:41 -0500
Subject: [PATCH] Fix broken build and buggos

---
 indra/llcommon/llsdserialize.cpp     | 9 ++++++---
 indra/llcommon/llsdserialize.h       | 2 +-
 indra/llcommon/llsdserialize_xml.cpp | 2 +-
 indra/newview/alaoengine.cpp         | 8 ++++----
 4 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp
index 22b24a06b4f..cf2df1f80b4 100644
--- a/indra/llcommon/llsdserialize.cpp
+++ b/indra/llcommon/llsdserialize.cpp
@@ -2097,7 +2097,8 @@ std::string zip_llsd(LLSD& data)
 		{ //copy result into output
 			if (strm.avail_out >= CHUNK)
 			{
-				free(output);
+				if(output)
+					free(output);
 				LL_WARNS() << "Failed to compress LLSD block." << LL_ENDL;
 				return std::string();
 			}
@@ -2120,7 +2121,8 @@ std::string zip_llsd(LLSD& data)
 		}
 		else 
 		{
-			free(output);
+			if(output)
+				free(output);
 			LL_WARNS() << "Failed to compress LLSD block." << LL_ENDL;
 			return std::string();
 		}
@@ -2131,7 +2133,8 @@ std::string zip_llsd(LLSD& data)
 
 	std::string result((char*) output, size);
 	deflateEnd(&strm);
-	free(output);
+	if(output)
+		free(output);
 
 	return result;
 }
diff --git a/indra/llcommon/llsdserialize.h b/indra/llcommon/llsdserialize.h
index 9702eca5733..d4bba6a4cfe 100644
--- a/indra/llcommon/llsdserialize.h
+++ b/indra/llcommon/llsdserialize.h
@@ -502,7 +502,7 @@ class LL_COMMON_API LLSDFormatter : public LLRefCount
 	void formatReal(LLSD::Real real, std::ostream& ostr) const;
 
 	bool mBoolAlpha;
-    std::unique_ptr<absl::ParsedFormat<absl::FormatConversionCharSet::kFloating> > mRealFormat;
+	std::string mRealFormat;
 	EFormatterOptions mOptions;
 };
 
diff --git a/indra/llcommon/llsdserialize_xml.cpp b/indra/llcommon/llsdserialize_xml.cpp
index e61a6000e22..c751288c4d6 100644
--- a/indra/llcommon/llsdserialize_xml.cpp
+++ b/indra/llcommon/llsdserialize_xml.cpp
@@ -150,7 +150,7 @@ S32 LLSDXMLFormatter::format_impl(const LLSD& data, std::ostream& ostr,
 
 	case LLSD::TypeReal:
 		ostr << pre << "<real>";
-		if(!mRealFormat)
+		if(mRealFormat.empty())
 		{
 			ostr << data.asReal();
 		}
diff --git a/indra/newview/alaoengine.cpp b/indra/newview/alaoengine.cpp
index 30b4f7bbd86..ad35646a651 100644
--- a/indra/newview/alaoengine.cpp
+++ b/indra/newview/alaoengine.cpp
@@ -1890,13 +1890,13 @@ void ALAOEngine::processImport(bool aFromTimer)
 		{
 			if (state->mCycleTime)
 			{
-				const std::string oldName = state->mName;
-				state->mName = absl::StrFormat("%s%d",oldName + ":CT",state->mCycleTime);
+				const std::string oldName = state->mName + ":CT";
+				state->mName = llformat("%s%d",oldName.c_str(),state->mCycleTime);
 			}
 			if (state->mCycle)
 			{
-				const std::string oldName = state->mName;
-				state->mName = absl::StrFormat("%s%s", oldName, ":CY");
+				const std::string& oldName = state->mName;
+				state->mName = llformat("%s%s", oldName.c_str(), ":CY");
 			}
 			allComplete = false;
 			LL_DEBUGS("AOEngine") << "state " << state->mName << " still has animations to link." << LL_ENDL;
-- 
GitLab