When the client calls libcouchbase_create and then later calls libcouchbase_destroy, some memory is leaked. For a client with many threads that open and close couchbase sessions, this will lead to memory exhaustion. The leak is caused by the use of strdup() in setup_boostrap_hosts(). These duplicated strings are not free'd in libcouchbase_destroy. The leak can be seen by using valgrind.
I have attached a proof of concept, and a patch with a proposed fix.
I have only tested on 1.0.2, but other versions may be affected.
|For Gerrit Dashboard: &For+CCBC-65=message:CCBC-65|
|16032,3||[CCBC-65] Memory leak in libcouchbase_create / libcouchbase_destroy||libcouchbase||Status: MERGED||+2||+1|
|16685,2||Merge branch 'release10'||libcouchbase||Status: MERGED||+2||+1|