[SR-Users] Memory leak in http_query() function (utils module)

Guillaume Bour libon.voiceteam at gmail.com
Fri Feb 14 14:42:57 CET 2014


Hi folks,

We identified a memory leak in *utils* module, when calling the 
http_query() function.
a memory piece is allocated with malloc() to store http request result 
string (functions.c:54), but this memory is never freed.

There is also a possible crash issue, because curl_easy_getinfo() is 
called *after* curl_easy_cleanup(), which must not be done (see 
http://curl.haxx.se/libcurl/c/curl_easy_cleanup.html)

I attached patches to fix those issues (applies to 4.0 branch)

Regards,
Guillaume Bour
-------------- next part --------------
A non-text attachment was scrubbed...
Name: utils_http_003_typo.patch
Type: text/x-patch
Size: 581 bytes
Desc: not available
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20140214/efa131eb/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: utils_http_002_curl_cleanup.patch
Type: text/x-patch
Size: 750 bytes
Desc: not available
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20140214/efa131eb/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: utils_http_001_memory_free.patch
Type: text/x-patch
Size: 1194 bytes
Desc: not available
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20140214/efa131eb/attachment-0002.bin>


More information about the sr-users mailing list