{"action":"created","issue":{"url":"https://api.github.com/repos/mongodb/mongo-c-driver/issues/254","labels_url":"https://api.github.com/repos/mongodb/mongo-c-driver/issues/254/labels{/name}","comments_url":"https://api.github.com/repos/mongodb/mongo-c-driver/issues/254/comments","events_url":"https://api.github.com/repos/mongodb/mongo-c-driver/issues/254/events","html_url":"https://github.com/mongodb/mongo-c-driver/pull/254","id":97991108,"number":254,"title":"Removed memory leak in function mongoc_database_has_collection","user":{"login":"canella","id":2510393,"avatar_url":"https://avatars.githubusercontent.com/u/2510393?v=3","gravatar_id":"","url":"https://api.github.com/users/canella","html_url":"https://github.com/canella","followers_url":"https://api.github.com/users/canella/followers","following_url":"https://api.github.com/users/canella/following{/other_user}","gists_url":"https://api.github.com/users/canella/gists{/gist_id}","starred_url":"https://api.github.com/users/canella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/canella/subscriptions","organizations_url":"https://api.github.com/users/canella/orgs","repos_url":"https://api.github.com/users/canella/repos","events_url":"https://api.github.com/users/canella/events{/privacy}","received_events_url":"https://api.github.com/users/canella/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-29T17:48:24Z","updated_at":"2015-07-29T18:06:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mongodb/mongo-c-driver/pulls/254","html_url":"https://github.com/mongodb/mongo-c-driver/pull/254","diff_url":"https://github.com/mongodb/mongo-c-driver/pull/254.diff","patch_url":"https://github.com/mongodb/mongo-c-driver/pull/254.patch"},"body":"If an invalid namespace is supplied to mongoc_database_has_collection the cursor that is used in this function is not freed causing a memory leak every time the function is called. This leads to a drastic increase in memory consumption if the function is called frequently."},"comment":{"url":"https://api.github.com/repos/mongodb/mongo-c-driver/issues/comments/126043458","html_url":"https://github.com/mongodb/mongo-c-driver/pull/254#issuecomment-126043458","issue_url":"https://api.github.com/repos/mongodb/mongo-c-driver/issues/254","id":126043458,"user":{"login":"canella","id":2510393,"avatar_url":"https://avatars.githubusercontent.com/u/2510393?v=3","gravatar_id":"","url":"https://api.github.com/users/canella","html_url":"https://github.com/canella","followers_url":"https://api.github.com/users/canella/followers","following_url":"https://api.github.com/users/canella/following{/other_user}","gists_url":"https://api.github.com/users/canella/gists{/gist_id}","starred_url":"https://api.github.com/users/canella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/canella/subscriptions","organizations_url":"https://api.github.com/users/canella/orgs","repos_url":"https://api.github.com/users/canella/repos","events_url":"https://api.github.com/users/canella/events{/privacy}","received_events_url":"https://api.github.com/users/canella/received_events","type":"User","site_admin":false},"created_at":"2015-07-29T18:06:22Z","updated_at":"2015-07-29T18:06:22Z","body":"Two pictures showing the memory consumption before and after applying the fix. In both cases the program ran over a minute while calling the function continuously.\r\n\r\n![mongoc_database_has_collection_fix](https://cloud.githubusercontent.com/assets/2510393/8965594/d5f12998-362c-11e5-9f83-1eb0eb0f2f97.png)\r\n![mongoc_database_has_collection_nofix](https://cloud.githubusercontent.com/assets/2510393/8965598/d9b37ca2-362c-11e5-8fc3-379489cf1654.png)"}}