Description
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.
Attachments
For Gerrit Dashboard: CCBC-65 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
16032,3 | [CCBC-65] Memory leak in libcouchbase_create / libcouchbase_destroy | release10 | libcouchbase | Status: MERGED | +2 | +1 |
16685,2 | Merge branch 'release10' | master | libcouchbase | Status: MERGED | +2 | +1 |