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)
Looks good to me.
Review request changed
Updated (May 17, 2011, 9:18 a.m.)
-
- added Diff r2
made the temporary string const
Other reviews