All submissions to this site are governed by the Second Life Viewer Contribution Agreement. By submitting patches and other information using this site, you acknowledge that you have read, understood, and agreed to those terms.

Review Board 1.6.11

Welcome to the Second Life Viewer Code Review tool.
See the documentation on our wiki for how to use this site.

VWR-25654: fix memory leak in LLTranslate::getTranslateUrl

Review Request #282 - Created May 1, 2011 and submitted

Boroondas Gupte Reviewers
viewer
VWR-25654
None viewer-development
curl_escape() returns a pointer to a C-string. When one is done with the C-string, one must curl_free() the pointer. (See http://curl.haxx.se/libcurl/c/curl_escape.html .) To be able to call curl_free on the pointer, we must keep it in the first place.

Also, a cpp file in which curl functions are called should include <curl/curl.h> directly, even if it already gets included indirectly, i.e. via other includes. So adding that, too.


Note that curl_escape() is deprecated and should be replaced by curl_easy_escape(). This change does not do that, as this should probably be done for all occurrences at once and be accompanied by some refactoring.
* Built Viewer (Linux 64bit STANDALONE)
* Verified that translation still works (logged in, enabled translation in nearby chat floater, changed "translate to" language in preferences > chat and went to Ahern)
Review request changed
Updated (May 17, 2011, 9:18 a.m.)
made the temporary string const