From 8fae347ba9d03faf8cca3d76b23a0985d85cccb3 Mon Sep 17 00:00:00 2001 From: Boroondas Gupte Date: Sun, 1 May 2011 22:04:06 +0200 Subject: VWR-25654 FIXED memory leak in LLTranslate::getTranslateUrl --- indra/newview/lltranslate.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/lltranslate.cpp') diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp index 050e34ade9..93a222d82a 100644 --- a/indra/newview/lltranslate.cpp +++ b/indra/newview/lltranslate.cpp @@ -82,7 +82,9 @@ void LLTranslate::translateMessage(LLHTTPClient::ResponderPtr &result, const std //static void LLTranslate::getTranslateUrl(std::string &translate_url, const std::string &from_lang, const std::string &to_lang, const std::string &mesg) { - std::string escaped_mesg = curl_escape(mesg.c_str(), mesg.size()); + char * curl_str = curl_escape(mesg.c_str(), mesg.size()); + std::string escaped_mesg(curl_str); + curl_free(curl_str); translate_url = m_GoogleURL + escaped_mesg + m_GoogleLangSpec -- cgit v1.2.3 From 4ea383b7a42d4f533c28ba715c77a4b1af6402e7 Mon Sep 17 00:00:00 2001 From: Boroondas Gupte Date: Sun, 1 May 2011 22:08:21 +0200 Subject: VWR-25654 FOLLOWUP Files that use curl functions should include directly, even if it already gets already included indirectly. --- indra/newview/lltranslate.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/lltranslate.cpp') diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp index 93a222d82a..3ef78e679b 100644 --- a/indra/newview/lltranslate.cpp +++ b/indra/newview/lltranslate.cpp @@ -34,6 +34,8 @@ #include "lltranslate.h" +#include + #include "llbufferstream.h" #include "llui.h" #include "llversionviewer.h" -- cgit v1.2.3 From 20a48876d0760c28ebbac379cd9da2e5aa2fb85d Mon Sep 17 00:00:00 2001 From: Boroondas Gupte Date: Tue, 17 May 2011 17:50:12 +0200 Subject: VWR-25654 FOLLOWUP made temporary string variable const --- indra/newview/lltranslate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/lltranslate.cpp') diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp index 3ef78e679b..902e229ee1 100644 --- a/indra/newview/lltranslate.cpp +++ b/indra/newview/lltranslate.cpp @@ -85,7 +85,7 @@ void LLTranslate::translateMessage(LLHTTPClient::ResponderPtr &result, const std void LLTranslate::getTranslateUrl(std::string &translate_url, const std::string &from_lang, const std::string &to_lang, const std::string &mesg) { char * curl_str = curl_escape(mesg.c_str(), mesg.size()); - std::string escaped_mesg(curl_str); + std::string const escaped_mesg(curl_str); curl_free(curl_str); translate_url = m_GoogleURL -- cgit v1.2.3