{"action":"created","comment":{"url":"https://api.github.com/repos/scalingdata/go-grok/pulls/comments/40929782","id":40929782,"diff_hunk":"@@ -52,8 +52,7 @@ int grok_match_walk_next(const grok_match_t *gm,\n   }\n \n   *namelen = gct->name_len;\n-  *name = malloc(*namelen);\n-  memcpy(*name, gct->name, *namelen);\n+  *name = gct->name;","path":"cgrok/grok_match.c","position":6,"original_position":6,"commit_id":"f32dfad13b7079c6908025da8548f89576d79b01","original_commit_id":"f32dfad13b7079c6908025da8548f89576d79b01","user":{"login":"adam-rocana","id":13948507,"avatar_url":"https://avatars.githubusercontent.com/u/13948507?v=3","gravatar_id":"","url":"https://api.github.com/users/adam-rocana","html_url":"https://github.com/adam-rocana","followers_url":"https://api.github.com/users/adam-rocana/followers","following_url":"https://api.github.com/users/adam-rocana/following{/other_user}","gists_url":"https://api.github.com/users/adam-rocana/gists{/gist_id}","starred_url":"https://api.github.com/users/adam-rocana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adam-rocana/subscriptions","organizations_url":"https://api.github.com/users/adam-rocana/orgs","repos_url":"https://api.github.com/users/adam-rocana/repos","events_url":"https://api.github.com/users/adam-rocana/events{/privacy}","received_events_url":"https://api.github.com/users/adam-rocana/received_events","type":"User","site_admin":false},"body":"Is this safe to do? I assume a new string was `malloc`ed because the lifetime of the `gct` pointer wasn't long or predictable enough for the caller of `grok_match_walk_next`. ","created_at":"2015-10-01T15:49:54Z","updated_at":"2015-10-01T15:49:54Z","html_url":"https://github.com/scalingdata/go-grok/pull/6#discussion_r40929782","pull_request_url":"https://api.github.com/repos/scalingdata/go-grok/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/scalingdata/go-grok/pulls/comments/40929782"},"html":{"href":"https://github.com/scalingdata/go-grok/pull/6#discussion_r40929782"},"pull_request":{"href":"https://api.github.com/repos/scalingdata/go-grok/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/scalingdata/go-grok/pulls/6","id":46476401,"html_url":"https://github.com/scalingdata/go-grok/pull/6","diff_url":"https://github.com/scalingdata/go-grok/pull/6.diff","patch_url":"https://github.com/scalingdata/go-grok/pull/6.patch","issue_url":"https://api.github.com/repos/scalingdata/go-grok/issues/6","number":6,"state":"open","locked":false,"title":"ROCANA-3543 Fix use-after-free and leak in Grok","user":{"login":"alanctgardner","id":3100188,"avatar_url":"https://avatars.githubusercontent.com/u/3100188?v=3","gravatar_id":"","url":"https://api.github.com/users/alanctgardner","html_url":"https://github.com/alanctgardner","followers_url":"https://api.github.com/users/alanctgardner/followers","following_url":"https://api.github.com/users/alanctgardner/following{/other_user}","gists_url":"https://api.github.com/users/alanctgardner/gists{/gist_id}","starred_url":"https://api.github.com/users/alanctgardner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alanctgardner/subscriptions","organizations_url":"https://api.github.com/users/alanctgardner/orgs","repos_url":"https://api.github.com/users/alanctgardner/repos","events_url":"https://api.github.com/users/alanctgardner/events{/privacy}","received_events_url":"https://api.github.com/users/alanctgardner/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-10-01T01:24:07Z","updated_at":"2015-10-01T15:49:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2cca0ebe2dec3f17ded22d5d4af1ab381c2a2f23","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scalingdata/go-grok/pulls/6/commits","review_comments_url":"https://api.github.com/repos/scalingdata/go-grok/pulls/6/comments","review_comment_url":"https://api.github.com/repos/scalingdata/go-grok/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scalingdata/go-grok/issues/6/comments","statuses_url":"https://api.github.com/repos/scalingdata/go-grok/statuses/f32dfad13b7079c6908025da8548f89576d79b01","head":{"label":"scalingdata:ROCANA-3543","ref":"ROCANA-3543","sha":"f32dfad13b7079c6908025da8548f89576d79b01","user":{"login":"scalingdata","id":6448302,"avatar_url":"https://avatars.githubusercontent.com/u/6448302?v=3","gravatar_id":"","url":"https://api.github.com/users/scalingdata","html_url":"https://github.com/scalingdata","followers_url":"https://api.github.com/users/scalingdata/followers","following_url":"https://api.github.com/users/scalingdata/following{/other_user}","gists_url":"https://api.github.com/users/scalingdata/gists{/gist_id}","starred_url":"https://api.github.com/users/scalingdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scalingdata/subscriptions","organizations_url":"https://api.github.com/users/scalingdata/orgs","repos_url":"https://api.github.com/users/scalingdata/repos","events_url":"https://api.github.com/users/scalingdata/events{/privacy}","received_events_url":"https://api.github.com/users/scalingdata/received_events","type":"Organization","site_admin":false},"repo":{"id":41033837,"name":"go-grok","full_name":"scalingdata/go-grok","owner":{"login":"scalingdata","id":6448302,"avatar_url":"https://avatars.githubusercontent.com/u/6448302?v=3","gravatar_id":"","url":"https://api.github.com/users/scalingdata","html_url":"https://github.com/scalingdata","followers_url":"https://api.github.com/users/scalingdata/followers","following_url":"https://api.github.com/users/scalingdata/following{/other_user}","gists_url":"https://api.github.com/users/scalingdata/gists{/gist_id}","starred_url":"https://api.github.com/users/scalingdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scalingdata/subscriptions","organizations_url":"https://api.github.com/users/scalingdata/orgs","repos_url":"https://api.github.com/users/scalingdata/repos","events_url":"https://api.github.com/users/scalingdata/events{/privacy}","received_events_url":"https://api.github.com/users/scalingdata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scalingdata/go-grok","description":"Golang bindings for Grok","fork":true,"url":"https://api.github.com/repos/scalingdata/go-grok","forks_url":"https://api.github.com/repos/scalingdata/go-grok/forks","keys_url":"https://api.github.com/repos/scalingdata/go-grok/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scalingdata/go-grok/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scalingdata/go-grok/teams","hooks_url":"https://api.github.com/repos/scalingdata/go-grok/hooks","issue_events_url":"https://api.github.com/repos/scalingdata/go-grok/issues/events{/number}","events_url":"https://api.github.com/repos/scalingdata/go-grok/events","assignees_url":"https://api.github.com/repos/scalingdata/go-grok/assignees{/user}","branches_url":"https://api.github.com/repos/scalingdata/go-grok/branches{/branch}","tags_url":"https://api.github.com/repos/scalingdata/go-grok/tags","blobs_url":"https://api.github.com/repos/scalingdata/go-grok/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scalingdata/go-grok/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scalingdata/go-grok/git/refs{/sha}","trees_url":"https://api.github.com/repos/scalingdata/go-grok/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scalingdata/go-grok/statuses/{sha}","languages_url":"https://api.github.com/repos/scalingdata/go-grok/languages","stargazers_url":"https://api.github.com/repos/scalingdata/go-grok/stargazers","contributors_url":"https://api.github.com/repos/scalingdata/go-grok/contributors","subscribers_url":"https://api.github.com/repos/scalingdata/go-grok/subscribers","subscription_url":"https://api.github.com/repos/scalingdata/go-grok/subscription","commits_url":"https://api.github.com/repos/scalingdata/go-grok/commits{/sha}","git_commits_url":"https://api.github.com/repos/scalingdata/go-grok/git/commits{/sha}","comments_url":"https://api.github.com/repos/scalingdata/go-grok/comments{/number}","issue_comment_url":"https://api.github.com/repos/scalingdata/go-grok/issues/comments{/number}","contents_url":"https://api.github.com/repos/scalingdata/go-grok/contents/{+path}","compare_url":"https://api.github.com/repos/scalingdata/go-grok/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scalingdata/go-grok/merges","archive_url":"https://api.github.com/repos/scalingdata/go-grok/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scalingdata/go-grok/downloads","issues_url":"https://api.github.com/repos/scalingdata/go-grok/issues{/number}","pulls_url":"https://api.github.com/repos/scalingdata/go-grok/pulls{/number}","milestones_url":"https://api.github.com/repos/scalingdata/go-grok/milestones{/number}","notifications_url":"https://api.github.com/repos/scalingdata/go-grok/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scalingdata/go-grok/labels{/name}","releases_url":"https://api.github.com/repos/scalingdata/go-grok/releases{/id}","created_at":"2015-08-19T12:58:46Z","updated_at":"2015-09-10T14:38:08Z","pushed_at":"2015-10-01T01:24:08Z","git_url":"git://github.com/scalingdata/go-grok.git","ssh_url":"git@github.com:scalingdata/go-grok.git","clone_url":"https://github.com/scalingdata/go-grok.git","svn_url":"https://github.com/scalingdata/go-grok","homepage":null,"size":740,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"scalingdata:exp/alan/named-groups","ref":"exp/alan/named-groups","sha":"9fe3c6735ca3e1aeef1143aa923b2ae58d5ab1de","user":{"login":"scalingdata","id":6448302,"avatar_url":"https://avatars.githubusercontent.com/u/6448302?v=3","gravatar_id":"","url":"https://api.github.com/users/scalingdata","html_url":"https://github.com/scalingdata","followers_url":"https://api.github.com/users/scalingdata/followers","following_url":"https://api.github.com/users/scalingdata/following{/other_user}","gists_url":"https://api.github.com/users/scalingdata/gists{/gist_id}","starred_url":"https://api.github.com/users/scalingdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scalingdata/subscriptions","organizations_url":"https://api.github.com/users/scalingdata/orgs","repos_url":"https://api.github.com/users/scalingdata/repos","events_url":"https://api.github.com/users/scalingdata/events{/privacy}","received_events_url":"https://api.github.com/users/scalingdata/received_events","type":"Organization","site_admin":false},"repo":{"id":41033837,"name":"go-grok","full_name":"scalingdata/go-grok","owner":{"login":"scalingdata","id":6448302,"avatar_url":"https://avatars.githubusercontent.com/u/6448302?v=3","gravatar_id":"","url":"https://api.github.com/users/scalingdata","html_url":"https://github.com/scalingdata","followers_url":"https://api.github.com/users/scalingdata/followers","following_url":"https://api.github.com/users/scalingdata/following{/other_user}","gists_url":"https://api.github.com/users/scalingdata/gists{/gist_id}","starred_url":"https://api.github.com/users/scalingdata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scalingdata/subscriptions","organizations_url":"https://api.github.com/users/scalingdata/orgs","repos_url":"https://api.github.com/users/scalingdata/repos","events_url":"https://api.github.com/users/scalingdata/events{/privacy}","received_events_url":"https://api.github.com/users/scalingdata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scalingdata/go-grok","description":"Golang bindings for Grok","fork":true,"url":"https://api.github.com/repos/scalingdata/go-grok","forks_url":"https://api.github.com/repos/scalingdata/go-grok/forks","keys_url":"https://api.github.com/repos/scalingdata/go-grok/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scalingdata/go-grok/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scalingdata/go-grok/teams","hooks_url":"https://api.github.com/repos/scalingdata/go-grok/hooks","issue_events_url":"https://api.github.com/repos/scalingdata/go-grok/issues/events{/number}","events_url":"https://api.github.com/repos/scalingdata/go-grok/events","assignees_url":"https://api.github.com/repos/scalingdata/go-grok/assignees{/user}","branches_url":"https://api.github.com/repos/scalingdata/go-grok/branches{/branch}","tags_url":"https://api.github.com/repos/scalingdata/go-grok/tags","blobs_url":"https://api.github.com/repos/scalingdata/go-grok/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scalingdata/go-grok/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scalingdata/go-grok/git/refs{/sha}","trees_url":"https://api.github.com/repos/scalingdata/go-grok/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scalingdata/go-grok/statuses/{sha}","languages_url":"https://api.github.com/repos/scalingdata/go-grok/languages","stargazers_url":"https://api.github.com/repos/scalingdata/go-grok/stargazers","contributors_url":"https://api.github.com/repos/scalingdata/go-grok/contributors","subscribers_url":"https://api.github.com/repos/scalingdata/go-grok/subscribers","subscription_url":"https://api.github.com/repos/scalingdata/go-grok/subscription","commits_url":"https://api.github.com/repos/scalingdata/go-grok/commits{/sha}","git_commits_url":"https://api.github.com/repos/scalingdata/go-grok/git/commits{/sha}","comments_url":"https://api.github.com/repos/scalingdata/go-grok/comments{/number}","issue_comment_url":"https://api.github.com/repos/scalingdata/go-grok/issues/comments{/number}","contents_url":"https://api.github.com/repos/scalingdata/go-grok/contents/{+path}","compare_url":"https://api.github.com/repos/scalingdata/go-grok/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scalingdata/go-grok/merges","archive_url":"https://api.github.com/repos/scalingdata/go-grok/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scalingdata/go-grok/downloads","issues_url":"https://api.github.com/repos/scalingdata/go-grok/issues{/number}","pulls_url":"https://api.github.com/repos/scalingdata/go-grok/pulls{/number}","milestones_url":"https://api.github.com/repos/scalingdata/go-grok/milestones{/number}","notifications_url":"https://api.github.com/repos/scalingdata/go-grok/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scalingdata/go-grok/labels{/name}","releases_url":"https://api.github.com/repos/scalingdata/go-grok/releases{/id}","created_at":"2015-08-19T12:58:46Z","updated_at":"2015-09-10T14:38:08Z","pushed_at":"2015-10-01T01:24:08Z","git_url":"git://github.com/scalingdata/go-grok.git","ssh_url":"git@github.com:scalingdata/go-grok.git","clone_url":"https://github.com/scalingdata/go-grok.git","svn_url":"https://github.com/scalingdata/go-grok","homepage":null,"size":740,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scalingdata/go-grok/pulls/6"},"html":{"href":"https://github.com/scalingdata/go-grok/pull/6"},"issue":{"href":"https://api.github.com/repos/scalingdata/go-grok/issues/6"},"comments":{"href":"https://api.github.com/repos/scalingdata/go-grok/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/scalingdata/go-grok/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/scalingdata/go-grok/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scalingdata/go-grok/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/scalingdata/go-grok/statuses/f32dfad13b7079c6908025da8548f89576d79b01"}}}}