{"action":"created","issue":{"url":"https://api.github.com/repos/axiomatic-systems/Bento4/issues/43","labels_url":"https://api.github.com/repos/axiomatic-systems/Bento4/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/axiomatic-systems/Bento4/issues/43/comments","events_url":"https://api.github.com/repos/axiomatic-systems/Bento4/issues/43/events","html_url":"https://github.com/axiomatic-systems/Bento4/issues/43","id":118894239,"number":43,"title":"Memory leak in AP4_NullTerminatedStringAtom","user":{"login":"fumoboy007","id":2100868,"avatar_url":"https://avatars.githubusercontent.com/u/2100868?v=3","gravatar_id":"","url":"https://api.github.com/users/fumoboy007","html_url":"https://github.com/fumoboy007","followers_url":"https://api.github.com/users/fumoboy007/followers","following_url":"https://api.github.com/users/fumoboy007/following{/other_user}","gists_url":"https://api.github.com/users/fumoboy007/gists{/gist_id}","starred_url":"https://api.github.com/users/fumoboy007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fumoboy007/subscriptions","organizations_url":"https://api.github.com/users/fumoboy007/orgs","repos_url":"https://api.github.com/users/fumoboy007/repos","events_url":"https://api.github.com/users/fumoboy007/events{/privacy}","received_events_url":"https://api.github.com/users/fumoboy007/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-25T18:14:05Z","updated_at":"2015-11-25T18:16:28Z","closed_at":"2015-11-25T18:16:28Z","body":"    AP4_NullTerminatedStringAtom::AP4_NullTerminatedStringAtom(AP4_Atom::Type  type, \r\n                                                               AP4_UI64        size, \r\n                                                               AP4_ByteStream& stream) :\r\n        AP4_Atom(type, size)\r\n    {\r\n        AP4_Size str_size = (AP4_Size)size-AP4_ATOM_HEADER_SIZE;\r\n        char* str = new char[str_size];\r\n        stream.Read(str, str_size);\r\n        str[str_size-1] = '\\0'; // force null-termination\r\n        m_Value = str;\r\n    }\r\n\r\n`str` is copied into a new `AP4_String` (`m_Value`), but it is never deleted."},"comment":{"url":"https://api.github.com/repos/axiomatic-systems/Bento4/issues/comments/159692069","html_url":"https://github.com/axiomatic-systems/Bento4/issues/43#issuecomment-159692069","issue_url":"https://api.github.com/repos/axiomatic-systems/Bento4/issues/43","id":159692069,"user":{"login":"fumoboy007","id":2100868,"avatar_url":"https://avatars.githubusercontent.com/u/2100868?v=3","gravatar_id":"","url":"https://api.github.com/users/fumoboy007","html_url":"https://github.com/fumoboy007","followers_url":"https://api.github.com/users/fumoboy007/followers","following_url":"https://api.github.com/users/fumoboy007/following{/other_user}","gists_url":"https://api.github.com/users/fumoboy007/gists{/gist_id}","starred_url":"https://api.github.com/users/fumoboy007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fumoboy007/subscriptions","organizations_url":"https://api.github.com/users/fumoboy007/orgs","repos_url":"https://api.github.com/users/fumoboy007/repos","events_url":"https://api.github.com/users/fumoboy007/events{/privacy}","received_events_url":"https://api.github.com/users/fumoboy007/received_events","type":"User","site_admin":false},"created_at":"2015-11-25T18:16:28Z","updated_at":"2015-11-25T18:16:28Z","body":"Never mind. `AP4_String::Assign` will delete `str`."}}