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.
|Field||Original Value||New Value|
|Status||Open [ 1 ]||Resolved [ 5 ]|
|Fix Version/s||1.0.4 [ 10327 ]|
|Resolution||Fixed [ 1 ]|
|Status||Resolved [ 5 ]||Closed [ 6 ]|
|Workflow||jira [ 17122 ]||Couchbase SDK Workflow [ 43728 ]|