{"action":"opened","number":18,"pull_request":{"url":"https://api.github.com/repos/csmith-project/csmith/pulls/18","id":48453759,"html_url":"https://github.com/csmith-project/csmith/pull/18","diff_url":"https://github.com/csmith-project/csmith/pull/18.diff","patch_url":"https://github.com/csmith-project/csmith/pull/18.patch","issue_url":"https://api.github.com/repos/csmith-project/csmith/issues/18","number":18,"state":"open","locked":false,"title":"memory leak in three functions","user":{"login":"jensgerlach","id":3425805,"avatar_url":"https://avatars.githubusercontent.com/u/3425805?v=3","gravatar_id":"","url":"https://api.github.com/users/jensgerlach","html_url":"https://github.com/jensgerlach","followers_url":"https://api.github.com/users/jensgerlach/followers","following_url":"https://api.github.com/users/jensgerlach/following{/other_user}","gists_url":"https://api.github.com/users/jensgerlach/gists{/gist_id}","starred_url":"https://api.github.com/users/jensgerlach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jensgerlach/subscriptions","organizations_url":"https://api.github.com/users/jensgerlach/orgs","repos_url":"https://api.github.com/users/jensgerlach/repos","events_url":"https://api.github.com/users/jensgerlach/events{/privacy}","received_events_url":"https://api.github.com/users/jensgerlach/received_events","type":"User","site_admin":false},"body":"In all three functions, a std::ofstream object is created by calling operator new.\r\nThe pointer returned by new is stored in a local variable and never explicitly deleted.\r\n\r\nThe fix creates the std::ofstream on the stack.\r\nThe file attached to the std::ofstream object is closed by the destructor.","created_at":"2015-10-22T12:58:03Z","updated_at":"2015-10-22T12:58:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/csmith-project/csmith/pulls/18/commits","review_comments_url":"https://api.github.com/repos/csmith-project/csmith/pulls/18/comments","review_comment_url":"https://api.github.com/repos/csmith-project/csmith/pulls/comments{/number}","comments_url":"https://api.github.com/repos/csmith-project/csmith/issues/18/comments","statuses_url":"https://api.github.com/repos/csmith-project/csmith/statuses/e904b53a3bccd67e6e71588517ed813741bec236","head":{"label":"jensgerlach:memoryleak","ref":"memoryleak","sha":"e904b53a3bccd67e6e71588517ed813741bec236","user":{"login":"jensgerlach","id":3425805,"avatar_url":"https://avatars.githubusercontent.com/u/3425805?v=3","gravatar_id":"","url":"https://api.github.com/users/jensgerlach","html_url":"https://github.com/jensgerlach","followers_url":"https://api.github.com/users/jensgerlach/followers","following_url":"https://api.github.com/users/jensgerlach/following{/other_user}","gists_url":"https://api.github.com/users/jensgerlach/gists{/gist_id}","starred_url":"https://api.github.com/users/jensgerlach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jensgerlach/subscriptions","organizations_url":"https://api.github.com/users/jensgerlach/orgs","repos_url":"https://api.github.com/users/jensgerlach/repos","events_url":"https://api.github.com/users/jensgerlach/events{/privacy}","received_events_url":"https://api.github.com/users/jensgerlach/received_events","type":"User","site_admin":false},"repo":{"id":44742939,"name":"csmith","full_name":"jensgerlach/csmith","owner":{"login":"jensgerlach","id":3425805,"avatar_url":"https://avatars.githubusercontent.com/u/3425805?v=3","gravatar_id":"","url":"https://api.github.com/users/jensgerlach","html_url":"https://github.com/jensgerlach","followers_url":"https://api.github.com/users/jensgerlach/followers","following_url":"https://api.github.com/users/jensgerlach/following{/other_user}","gists_url":"https://api.github.com/users/jensgerlach/gists{/gist_id}","starred_url":"https://api.github.com/users/jensgerlach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jensgerlach/subscriptions","organizations_url":"https://api.github.com/users/jensgerlach/orgs","repos_url":"https://api.github.com/users/jensgerlach/repos","events_url":"https://api.github.com/users/jensgerlach/events{/privacy}","received_events_url":"https://api.github.com/users/jensgerlach/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jensgerlach/csmith","description":"Csmith, a random generator of C programs","fork":true,"url":"https://api.github.com/repos/jensgerlach/csmith","forks_url":"https://api.github.com/repos/jensgerlach/csmith/forks","keys_url":"https://api.github.com/repos/jensgerlach/csmith/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jensgerlach/csmith/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jensgerlach/csmith/teams","hooks_url":"https://api.github.com/repos/jensgerlach/csmith/hooks","issue_events_url":"https://api.github.com/repos/jensgerlach/csmith/issues/events{/number}","events_url":"https://api.github.com/repos/jensgerlach/csmith/events","assignees_url":"https://api.github.com/repos/jensgerlach/csmith/assignees{/user}","branches_url":"https://api.github.com/repos/jensgerlach/csmith/branches{/branch}","tags_url":"https://api.github.com/repos/jensgerlach/csmith/tags","blobs_url":"https://api.github.com/repos/jensgerlach/csmith/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jensgerlach/csmith/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jensgerlach/csmith/git/refs{/sha}","trees_url":"https://api.github.com/repos/jensgerlach/csmith/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jensgerlach/csmith/statuses/{sha}","languages_url":"https://api.github.com/repos/jensgerlach/csmith/languages","stargazers_url":"https://api.github.com/repos/jensgerlach/csmith/stargazers","contributors_url":"https://api.github.com/repos/jensgerlach/csmith/contributors","subscribers_url":"https://api.github.com/repos/jensgerlach/csmith/subscribers","subscription_url":"https://api.github.com/repos/jensgerlach/csmith/subscription","commits_url":"https://api.github.com/repos/jensgerlach/csmith/commits{/sha}","git_commits_url":"https://api.github.com/repos/jensgerlach/csmith/git/commits{/sha}","comments_url":"https://api.github.com/repos/jensgerlach/csmith/comments{/number}","issue_comment_url":"https://api.github.com/repos/jensgerlach/csmith/issues/comments{/number}","contents_url":"https://api.github.com/repos/jensgerlach/csmith/contents/{+path}","compare_url":"https://api.github.com/repos/jensgerlach/csmith/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jensgerlach/csmith/merges","archive_url":"https://api.github.com/repos/jensgerlach/csmith/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jensgerlach/csmith/downloads","issues_url":"https://api.github.com/repos/jensgerlach/csmith/issues{/number}","pulls_url":"https://api.github.com/repos/jensgerlach/csmith/pulls{/number}","milestones_url":"https://api.github.com/repos/jensgerlach/csmith/milestones{/number}","notifications_url":"https://api.github.com/repos/jensgerlach/csmith/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jensgerlach/csmith/labels{/name}","releases_url":"https://api.github.com/repos/jensgerlach/csmith/releases{/id}","created_at":"2015-10-22T12:12:05Z","updated_at":"2015-10-22T12:12:07Z","pushed_at":"2015-10-22T12:43:13Z","git_url":"git://github.com/jensgerlach/csmith.git","ssh_url":"git@github.com:jensgerlach/csmith.git","clone_url":"https://github.com/jensgerlach/csmith.git","svn_url":"https://github.com/jensgerlach/csmith","homepage":"http://embed.cs.utah.edu/csmith/","size":8725,"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":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"csmith-project:master","ref":"master","sha":"1e18c8125664a90307a3775627971ee8b25875d1","user":{"login":"csmith-project","id":757200,"avatar_url":"https://avatars.githubusercontent.com/u/757200?v=3","gravatar_id":"","url":"https://api.github.com/users/csmith-project","html_url":"https://github.com/csmith-project","followers_url":"https://api.github.com/users/csmith-project/followers","following_url":"https://api.github.com/users/csmith-project/following{/other_user}","gists_url":"https://api.github.com/users/csmith-project/gists{/gist_id}","starred_url":"https://api.github.com/users/csmith-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csmith-project/subscriptions","organizations_url":"https://api.github.com/users/csmith-project/orgs","repos_url":"https://api.github.com/users/csmith-project/repos","events_url":"https://api.github.com/users/csmith-project/events{/privacy}","received_events_url":"https://api.github.com/users/csmith-project/received_events","type":"Organization","site_admin":false},"repo":{"id":1698955,"name":"csmith","full_name":"csmith-project/csmith","owner":{"login":"csmith-project","id":757200,"avatar_url":"https://avatars.githubusercontent.com/u/757200?v=3","gravatar_id":"","url":"https://api.github.com/users/csmith-project","html_url":"https://github.com/csmith-project","followers_url":"https://api.github.com/users/csmith-project/followers","following_url":"https://api.github.com/users/csmith-project/following{/other_user}","gists_url":"https://api.github.com/users/csmith-project/gists{/gist_id}","starred_url":"https://api.github.com/users/csmith-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csmith-project/subscriptions","organizations_url":"https://api.github.com/users/csmith-project/orgs","repos_url":"https://api.github.com/users/csmith-project/repos","events_url":"https://api.github.com/users/csmith-project/events{/privacy}","received_events_url":"https://api.github.com/users/csmith-project/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/csmith-project/csmith","description":"Csmith, a random generator of C programs","fork":false,"url":"https://api.github.com/repos/csmith-project/csmith","forks_url":"https://api.github.com/repos/csmith-project/csmith/forks","keys_url":"https://api.github.com/repos/csmith-project/csmith/keys{/key_id}","collaborators_url":"https://api.github.com/repos/csmith-project/csmith/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/csmith-project/csmith/teams","hooks_url":"https://api.github.com/repos/csmith-project/csmith/hooks","issue_events_url":"https://api.github.com/repos/csmith-project/csmith/issues/events{/number}","events_url":"https://api.github.com/repos/csmith-project/csmith/events","assignees_url":"https://api.github.com/repos/csmith-project/csmith/assignees{/user}","branches_url":"https://api.github.com/repos/csmith-project/csmith/branches{/branch}","tags_url":"https://api.github.com/repos/csmith-project/csmith/tags","blobs_url":"https://api.github.com/repos/csmith-project/csmith/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/csmith-project/csmith/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/csmith-project/csmith/git/refs{/sha}","trees_url":"https://api.github.com/repos/csmith-project/csmith/git/trees{/sha}","statuses_url":"https://api.github.com/repos/csmith-project/csmith/statuses/{sha}","languages_url":"https://api.github.com/repos/csmith-project/csmith/languages","stargazers_url":"https://api.github.com/repos/csmith-project/csmith/stargazers","contributors_url":"https://api.github.com/repos/csmith-project/csmith/contributors","subscribers_url":"https://api.github.com/repos/csmith-project/csmith/subscribers","subscription_url":"https://api.github.com/repos/csmith-project/csmith/subscription","commits_url":"https://api.github.com/repos/csmith-project/csmith/commits{/sha}","git_commits_url":"https://api.github.com/repos/csmith-project/csmith/git/commits{/sha}","comments_url":"https://api.github.com/repos/csmith-project/csmith/comments{/number}","issue_comment_url":"https://api.github.com/repos/csmith-project/csmith/issues/comments{/number}","contents_url":"https://api.github.com/repos/csmith-project/csmith/contents/{+path}","compare_url":"https://api.github.com/repos/csmith-project/csmith/compare/{base}...{head}","merges_url":"https://api.github.com/repos/csmith-project/csmith/merges","archive_url":"https://api.github.com/repos/csmith-project/csmith/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/csmith-project/csmith/downloads","issues_url":"https://api.github.com/repos/csmith-project/csmith/issues{/number}","pulls_url":"https://api.github.com/repos/csmith-project/csmith/pulls{/number}","milestones_url":"https://api.github.com/repos/csmith-project/csmith/milestones{/number}","notifications_url":"https://api.github.com/repos/csmith-project/csmith/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/csmith-project/csmith/labels{/name}","releases_url":"https://api.github.com/repos/csmith-project/csmith/releases{/id}","created_at":"2011-05-04T00:14:23Z","updated_at":"2015-10-21T08:44:43Z","pushed_at":"2015-10-05T20:05:20Z","git_url":"git://github.com/csmith-project/csmith.git","ssh_url":"git@github.com:csmith-project/csmith.git","clone_url":"https://github.com/csmith-project/csmith.git","svn_url":"https://github.com/csmith-project/csmith","homepage":"http://embed.cs.utah.edu/csmith/","size":9750,"stargazers_count":129,"watchers_count":129,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":7,"forks":22,"open_issues":7,"watchers":129,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/csmith-project/csmith/pulls/18"},"html":{"href":"https://github.com/csmith-project/csmith/pull/18"},"issue":{"href":"https://api.github.com/repos/csmith-project/csmith/issues/18"},"comments":{"href":"https://api.github.com/repos/csmith-project/csmith/issues/18/comments"},"review_comments":{"href":"https://api.github.com/repos/csmith-project/csmith/pulls/18/comments"},"review_comment":{"href":"https://api.github.com/repos/csmith-project/csmith/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/csmith-project/csmith/pulls/18/commits"},"statuses":{"href":"https://api.github.com/repos/csmith-project/csmith/statuses/e904b53a3bccd67e6e71588517ed813741bec236"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":12,"deletions":13,"changed_files":2}}