{"action":"created","issue":{"url":"https://api.github.com/repos/kamailio/kamailio/issues/611","repository_url":"https://api.github.com/repos/kamailio/kamailio","labels_url":"https://api.github.com/repos/kamailio/kamailio/issues/611/labels{/name}","comments_url":"https://api.github.com/repos/kamailio/kamailio/issues/611/comments","events_url":"https://api.github.com/repos/kamailio/kamailio/issues/611/events","html_url":"https://github.com/kamailio/kamailio/pull/611","id":154114761,"number":611,"title":"Free database column name as part of database result cleanup","user":{"login":"quentusrex","id":187192,"avatar_url":"https://avatars.githubusercontent.com/u/187192?v=3","gravatar_id":"","url":"https://api.github.com/users/quentusrex","html_url":"https://github.com/quentusrex","followers_url":"https://api.github.com/users/quentusrex/followers","following_url":"https://api.github.com/users/quentusrex/following{/other_user}","gists_url":"https://api.github.com/users/quentusrex/gists{/gist_id}","starred_url":"https://api.github.com/users/quentusrex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quentusrex/subscriptions","organizations_url":"https://api.github.com/users/quentusrex/orgs","repos_url":"https://api.github.com/users/quentusrex/repos","events_url":"https://api.github.com/users/quentusrex/events{/privacy}","received_events_url":"https://api.github.com/users/quentusrex/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-10T21:48:13Z","updated_at":"2016-05-11T14:13:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/kamailio/kamailio/pulls/611","html_url":"https://github.com/kamailio/kamailio/pull/611","diff_url":"https://github.com/kamailio/kamailio/pull/611.diff","patch_url":"https://github.com/kamailio/kamailio/pull/611.patch"},"body":"The column name is currently not free'd. Some db bankends copy this\r\ndata so that memory is leaked. Some store internal database pointers\r\nand those shouldn't be free'd. One returns a pointer to a stack\r\nvariable which shouldn't be done.\r\n\r\nThe patch cleans up all db backends to copy the column name and frees\r\nthat column name as part of the database result cleanup function.\r\n\r\nAuthor: Chris Double <doublec@silentcircle.com>"},"comment":{"url":"https://api.github.com/repos/kamailio/kamailio/issues/comments/218471897","html_url":"https://github.com/kamailio/kamailio/pull/611#issuecomment-218471897","issue_url":"https://api.github.com/repos/kamailio/kamailio/issues/611","id":218471897,"user":{"login":"quentusrex","id":187192,"avatar_url":"https://avatars.githubusercontent.com/u/187192?v=3","gravatar_id":"","url":"https://api.github.com/users/quentusrex","html_url":"https://github.com/quentusrex","followers_url":"https://api.github.com/users/quentusrex/followers","following_url":"https://api.github.com/users/quentusrex/following{/other_user}","gists_url":"https://api.github.com/users/quentusrex/gists{/gist_id}","starred_url":"https://api.github.com/users/quentusrex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quentusrex/subscriptions","organizations_url":"https://api.github.com/users/quentusrex/orgs","repos_url":"https://api.github.com/users/quentusrex/repos","events_url":"https://api.github.com/users/quentusrex/events{/privacy}","received_events_url":"https://api.github.com/users/quentusrex/received_events","type":"User","site_admin":false},"created_at":"2016-05-11T14:13:35Z","updated_at":"2016-05-11T14:13:35Z","body":"@miconda Makes sense. No need to malloc/free if it isn't absolutely required for a commonly used code path. I'll look over the patch and see if I can see a better approach(using flags to signify malloced pointer). One of the larger concerns here was that clang's address sanitizer was pointing out that at least one of the cases there was a pointer to stack memory being returned, which could lead to bad things as that stack frame was used by another thread."}}