{"action":"created","issue":{"url":"https://api.github.com/repos/zserge/jsmn/issues/55","labels_url":"https://api.github.com/repos/zserge/jsmn/issues/55/labels{/name}","comments_url":"https://api.github.com/repos/zserge/jsmn/issues/55/comments","events_url":"https://api.github.com/repos/zserge/jsmn/issues/55/events","html_url":"https://github.com/zserge/jsmn/pull/55","id":113181675,"number":55,"title":"small fix of jsondump example for cases of realloc failures","user":{"login":"goriy","id":14969214,"avatar_url":"https://avatars.githubusercontent.com/u/14969214?v=3","gravatar_id":"","url":"https://api.github.com/users/goriy","html_url":"https://github.com/goriy","followers_url":"https://api.github.com/users/goriy/followers","following_url":"https://api.github.com/users/goriy/following{/other_user}","gists_url":"https://api.github.com/users/goriy/gists{/gist_id}","starred_url":"https://api.github.com/users/goriy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/goriy/subscriptions","organizations_url":"https://api.github.com/users/goriy/orgs","repos_url":"https://api.github.com/users/goriy/repos","events_url":"https://api.github.com/users/goriy/events{/privacy}","received_events_url":"https://api.github.com/users/goriy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-24T20:36:25Z","updated_at":"2015-10-25T06:17:04Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/zserge/jsmn/pulls/55","html_url":"https://github.com/zserge/jsmn/pull/55","diff_url":"https://github.com/zserge/jsmn/pull/55.diff","patch_url":"https://github.com/zserge/jsmn/pull/55.patch"},"body":"When realloc() function fails it returns NULL pointer.\r\nBut old data pointer remains valid in such a case.\r\n\r\nIt's a mistake to use old data pointer to store new\r\npointer returned by realloc. In case of realloc failure,\r\npointer is overwritten with NULL value, but old used memory\r\nremains unreferenced and could not be even freed anymore.\r\nSuch mistakes could lead to memory leaks."},"comment":{"url":"https://api.github.com/repos/zserge/jsmn/issues/comments/150896068","html_url":"https://github.com/zserge/jsmn/pull/55#issuecomment-150896068","issue_url":"https://api.github.com/repos/zserge/jsmn/issues/55","id":150896068,"user":{"login":"MacGritsch","id":364551,"avatar_url":"https://avatars.githubusercontent.com/u/364551?v=3","gravatar_id":"","url":"https://api.github.com/users/MacGritsch","html_url":"https://github.com/MacGritsch","followers_url":"https://api.github.com/users/MacGritsch/followers","following_url":"https://api.github.com/users/MacGritsch/following{/other_user}","gists_url":"https://api.github.com/users/MacGritsch/gists{/gist_id}","starred_url":"https://api.github.com/users/MacGritsch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MacGritsch/subscriptions","organizations_url":"https://api.github.com/users/MacGritsch/orgs","repos_url":"https://api.github.com/users/MacGritsch/repos","events_url":"https://api.github.com/users/MacGritsch/events{/privacy}","received_events_url":"https://api.github.com/users/MacGritsch/received_events","type":"User","site_admin":false},"created_at":"2015-10-25T06:17:04Z","updated_at":"2015-10-25T06:17:04Z","body":"if available you can use reallocf for that, if not you can create an inline function.."}}