[opensource-dev] Review Request: VWR-25654: fix memory leak in LLTranslate::getTranslateUrl

Boroondas Gupte sllists at boroon.dasgupta.ch
Tue May 17 09:18:05 PDT 2011


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://codereview.secondlife.com/r/282/
-----------------------------------------------------------

(Updated May 17, 2011, 9:18 a.m.)


Review request for Viewer.


Changes
-------

made the temporary string const


Summary
-------

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.


This addresses bug VWR-25654.
    http://jira.secondlife.com/browse/VWR-25654


Diffs (updated)
-----

  doc/contributions.txt 9ff8625cadec 
  indra/newview/lltranslate.cpp 9ff8625cadec 

Diff: http://codereview.secondlife.com/r/282/diff


Testing
-------

* 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)


Thanks,

Boroondas

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.secondlife.com/pipermail/opensource-dev/attachments/20110517/613bcc13/attachment-0001.htm 


More information about the opensource-dev mailing list