{"action":"closed","number":2,"pull_request":{"url":"https://api.github.com/repos/hughsie/colord-gtk/pulls/2","id":36237962,"html_url":"https://github.com/hughsie/colord-gtk/pull/2","diff_url":"https://github.com/hughsie/colord-gtk/pull/2.diff","patch_url":"https://github.com/hughsie/colord-gtk/pull/2.patch","issue_url":"https://api.github.com/repos/hughsie/colord-gtk/issues/2","number":2,"state":"closed","locked":false,"title":"cd_window_update_widget_plug_name(): do not leak plug_name","user":{"login":"LebedevRI","id":88600,"avatar_url":"https://avatars.githubusercontent.com/u/88600?v=3","gravatar_id":"","url":"https://api.github.com/users/LebedevRI","html_url":"https://github.com/LebedevRI","followers_url":"https://api.github.com/users/LebedevRI/followers","following_url":"https://api.github.com/users/LebedevRI/following{/other_user}","gists_url":"https://api.github.com/users/LebedevRI/gists{/gist_id}","starred_url":"https://api.github.com/users/LebedevRI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LebedevRI/subscriptions","organizations_url":"https://api.github.com/users/LebedevRI/orgs","repos_url":"https://api.github.com/users/LebedevRI/repos","events_url":"https://api.github.com/users/LebedevRI/events{/privacy}","received_events_url":"https://api.github.com/users/LebedevRI/received_events","type":"User","site_admin":false},"body":"I was working on fixing leaks in darktable, and found this.\r\n\r\nI have installed colord-gtk with this change into /usr/local, and verified that this fixes the LeakSanitizer complaint, makes darktable free of any colord-related (colord and colord-gtk) leaks (or, at least i was not able to trigger others...) and does not seem to cause any side-effects (at least so far).\r\n\r\n[gdk_screen_get_monitor_plug_name() \"Returns a newly-allocated string containing the name of the monitor\"](https://developer.gnome.org/gdk3/stable/GdkScreen.html#gdk-screen-get-monitor-plug-name)\r\nwhich means, now it is our duty to g_free() it.\r\n\r\nAlso, no reason to g_strdup() it.\r\n\r\nFixes several LeakSanitizer-detected leaks like:\r\n```\r\nDirect leak of 36 byte(s) in 6 object(s) allocated from:\r\n    0 0x7f4b64a7c74f in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.1+0x5474f)\r\n    1 0x7f4b61e17799 in g_malloc (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x4f799)\r\n    2 0x7f4b61e3012e in g_strdup (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x6812e)\r\n    3 0x7f4b5d3a6078 in cd_window_update_widget_plug_name /home/lebedevri/src/colord-gtk/libcolord-gtk/cd-window.c:390\r\n    4 0x7f4b5d3a6cdd in cd_window_get_profile /home/lebedevri/src/colord-gtk/libcolord-gtk/cd-window.c:452\r\n    5 0x7f4b64456504 in dt_ctl_set_display_profile /home/lebedevri/darktable/src/control/control.c:214\r\n    6 0x7f4b64585c87 in configure /home/lebedevri/darktable/src/gui/gtk.c:611\r\n```","created_at":"2015-05-26T19:42:00Z","updated_at":"2015-05-26T20:45:20Z","closed_at":"2015-05-26T20:45:20Z","merged_at":"2015-05-26T20:45:20Z","merge_commit_sha":"5f2c01a34ba99709e6a79feb4d61babe9b6693e2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hughsie/colord-gtk/pulls/2/commits","review_comments_url":"https://api.github.com/repos/hughsie/colord-gtk/pulls/2/comments","review_comment_url":"https://api.github.com/repos/hughsie/colord-gtk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hughsie/colord-gtk/issues/2/comments","statuses_url":"https://api.github.com/repos/hughsie/colord-gtk/statuses/bccbb1ceb52cedba89d78abcaa78a4a8478a565e","head":{"label":"LebedevRI:cd_window_update_widget_plug_name-do-not-leak-plug_name","ref":"cd_window_update_widget_plug_name-do-not-leak-plug_name","sha":"bccbb1ceb52cedba89d78abcaa78a4a8478a565e","user":{"login":"LebedevRI","id":88600,"avatar_url":"https://avatars.githubusercontent.com/u/88600?v=3","gravatar_id":"","url":"https://api.github.com/users/LebedevRI","html_url":"https://github.com/LebedevRI","followers_url":"https://api.github.com/users/LebedevRI/followers","following_url":"https://api.github.com/users/LebedevRI/following{/other_user}","gists_url":"https://api.github.com/users/LebedevRI/gists{/gist_id}","starred_url":"https://api.github.com/users/LebedevRI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LebedevRI/subscriptions","organizations_url":"https://api.github.com/users/LebedevRI/orgs","repos_url":"https://api.github.com/users/LebedevRI/repos","events_url":"https://api.github.com/users/LebedevRI/events{/privacy}","received_events_url":"https://api.github.com/users/LebedevRI/received_events","type":"User","site_admin":false},"repo":{"id":36319203,"name":"colord-gtk","full_name":"LebedevRI/colord-gtk","owner":{"login":"LebedevRI","id":88600,"avatar_url":"https://avatars.githubusercontent.com/u/88600?v=3","gravatar_id":"","url":"https://api.github.com/users/LebedevRI","html_url":"https://github.com/LebedevRI","followers_url":"https://api.github.com/users/LebedevRI/followers","following_url":"https://api.github.com/users/LebedevRI/following{/other_user}","gists_url":"https://api.github.com/users/LebedevRI/gists{/gist_id}","starred_url":"https://api.github.com/users/LebedevRI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LebedevRI/subscriptions","organizations_url":"https://api.github.com/users/LebedevRI/orgs","repos_url":"https://api.github.com/users/LebedevRI/repos","events_url":"https://api.github.com/users/LebedevRI/events{/privacy}","received_events_url":"https://api.github.com/users/LebedevRI/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/LebedevRI/colord-gtk","description":"Additional GTK support code for colord","fork":true,"url":"https://api.github.com/repos/LebedevRI/colord-gtk","forks_url":"https://api.github.com/repos/LebedevRI/colord-gtk/forks","keys_url":"https://api.github.com/repos/LebedevRI/colord-gtk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LebedevRI/colord-gtk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LebedevRI/colord-gtk/teams","hooks_url":"https://api.github.com/repos/LebedevRI/colord-gtk/hooks","issue_events_url":"https://api.github.com/repos/LebedevRI/colord-gtk/issues/events{/number}","events_url":"https://api.github.com/repos/LebedevRI/colord-gtk/events","assignees_url":"https://api.github.com/repos/LebedevRI/colord-gtk/assignees{/user}","branches_url":"https://api.github.com/repos/LebedevRI/colord-gtk/branches{/branch}","tags_url":"https://api.github.com/repos/LebedevRI/colord-gtk/tags","blobs_url":"https://api.github.com/repos/LebedevRI/colord-gtk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LebedevRI/colord-gtk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LebedevRI/colord-gtk/git/refs{/sha}","trees_url":"https://api.github.com/repos/LebedevRI/colord-gtk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LebedevRI/colord-gtk/statuses/{sha}","languages_url":"https://api.github.com/repos/LebedevRI/colord-gtk/languages","stargazers_url":"https://api.github.com/repos/LebedevRI/colord-gtk/stargazers","contributors_url":"https://api.github.com/repos/LebedevRI/colord-gtk/contributors","subscribers_url":"https://api.github.com/repos/LebedevRI/colord-gtk/subscribers","subscription_url":"https://api.github.com/repos/LebedevRI/colord-gtk/subscription","commits_url":"https://api.github.com/repos/LebedevRI/colord-gtk/commits{/sha}","git_commits_url":"https://api.github.com/repos/LebedevRI/colord-gtk/git/commits{/sha}","comments_url":"https://api.github.com/repos/LebedevRI/colord-gtk/comments{/number}","issue_comment_url":"https://api.github.com/repos/LebedevRI/colord-gtk/issues/comments{/number}","contents_url":"https://api.github.com/repos/LebedevRI/colord-gtk/contents/{+path}","compare_url":"https://api.github.com/repos/LebedevRI/colord-gtk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LebedevRI/colord-gtk/merges","archive_url":"https://api.github.com/repos/LebedevRI/colord-gtk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LebedevRI/colord-gtk/downloads","issues_url":"https://api.github.com/repos/LebedevRI/colord-gtk/issues{/number}","pulls_url":"https://api.github.com/repos/LebedevRI/colord-gtk/pulls{/number}","milestones_url":"https://api.github.com/repos/LebedevRI/colord-gtk/milestones{/number}","notifications_url":"https://api.github.com/repos/LebedevRI/colord-gtk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LebedevRI/colord-gtk/labels{/name}","releases_url":"https://api.github.com/repos/LebedevRI/colord-gtk/releases{/id}","created_at":"2015-05-26T19:36:27Z","updated_at":"2015-05-26T19:36:27Z","pushed_at":"2015-05-26T19:37:41Z","git_url":"git://github.com/LebedevRI/colord-gtk.git","ssh_url":"git@github.com:LebedevRI/colord-gtk.git","clone_url":"https://github.com/LebedevRI/colord-gtk.git","svn_url":"https://github.com/LebedevRI/colord-gtk","homepage":null,"size":147,"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":"hughsie:master","ref":"master","sha":"d1fdf05c9557cbe16ab1f930ddcf1c8143023449","user":{"login":"hughsie","id":151380,"avatar_url":"https://avatars.githubusercontent.com/u/151380?v=3","gravatar_id":"","url":"https://api.github.com/users/hughsie","html_url":"https://github.com/hughsie","followers_url":"https://api.github.com/users/hughsie/followers","following_url":"https://api.github.com/users/hughsie/following{/other_user}","gists_url":"https://api.github.com/users/hughsie/gists{/gist_id}","starred_url":"https://api.github.com/users/hughsie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hughsie/subscriptions","organizations_url":"https://api.github.com/users/hughsie/orgs","repos_url":"https://api.github.com/users/hughsie/repos","events_url":"https://api.github.com/users/hughsie/events{/privacy}","received_events_url":"https://api.github.com/users/hughsie/received_events","type":"User","site_admin":false},"repo":{"id":9096436,"name":"colord-gtk","full_name":"hughsie/colord-gtk","owner":{"login":"hughsie","id":151380,"avatar_url":"https://avatars.githubusercontent.com/u/151380?v=3","gravatar_id":"","url":"https://api.github.com/users/hughsie","html_url":"https://github.com/hughsie","followers_url":"https://api.github.com/users/hughsie/followers","following_url":"https://api.github.com/users/hughsie/following{/other_user}","gists_url":"https://api.github.com/users/hughsie/gists{/gist_id}","starred_url":"https://api.github.com/users/hughsie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hughsie/subscriptions","organizations_url":"https://api.github.com/users/hughsie/orgs","repos_url":"https://api.github.com/users/hughsie/repos","events_url":"https://api.github.com/users/hughsie/events{/privacy}","received_events_url":"https://api.github.com/users/hughsie/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hughsie/colord-gtk","description":"Additional GTK support code for colord","fork":false,"url":"https://api.github.com/repos/hughsie/colord-gtk","forks_url":"https://api.github.com/repos/hughsie/colord-gtk/forks","keys_url":"https://api.github.com/repos/hughsie/colord-gtk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hughsie/colord-gtk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hughsie/colord-gtk/teams","hooks_url":"https://api.github.com/repos/hughsie/colord-gtk/hooks","issue_events_url":"https://api.github.com/repos/hughsie/colord-gtk/issues/events{/number}","events_url":"https://api.github.com/repos/hughsie/colord-gtk/events","assignees_url":"https://api.github.com/repos/hughsie/colord-gtk/assignees{/user}","branches_url":"https://api.github.com/repos/hughsie/colord-gtk/branches{/branch}","tags_url":"https://api.github.com/repos/hughsie/colord-gtk/tags","blobs_url":"https://api.github.com/repos/hughsie/colord-gtk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hughsie/colord-gtk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hughsie/colord-gtk/git/refs{/sha}","trees_url":"https://api.github.com/repos/hughsie/colord-gtk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hughsie/colord-gtk/statuses/{sha}","languages_url":"https://api.github.com/repos/hughsie/colord-gtk/languages","stargazers_url":"https://api.github.com/repos/hughsie/colord-gtk/stargazers","contributors_url":"https://api.github.com/repos/hughsie/colord-gtk/contributors","subscribers_url":"https://api.github.com/repos/hughsie/colord-gtk/subscribers","subscription_url":"https://api.github.com/repos/hughsie/colord-gtk/subscription","commits_url":"https://api.github.com/repos/hughsie/colord-gtk/commits{/sha}","git_commits_url":"https://api.github.com/repos/hughsie/colord-gtk/git/commits{/sha}","comments_url":"https://api.github.com/repos/hughsie/colord-gtk/comments{/number}","issue_comment_url":"https://api.github.com/repos/hughsie/colord-gtk/issues/comments{/number}","contents_url":"https://api.github.com/repos/hughsie/colord-gtk/contents/{+path}","compare_url":"https://api.github.com/repos/hughsie/colord-gtk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hughsie/colord-gtk/merges","archive_url":"https://api.github.com/repos/hughsie/colord-gtk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hughsie/colord-gtk/downloads","issues_url":"https://api.github.com/repos/hughsie/colord-gtk/issues{/number}","pulls_url":"https://api.github.com/repos/hughsie/colord-gtk/pulls{/number}","milestones_url":"https://api.github.com/repos/hughsie/colord-gtk/milestones{/number}","notifications_url":"https://api.github.com/repos/hughsie/colord-gtk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hughsie/colord-gtk/labels{/name}","releases_url":"https://api.github.com/repos/hughsie/colord-gtk/releases{/id}","created_at":"2013-03-29T10:18:21Z","updated_at":"2014-12-02T15:09:51Z","pushed_at":"2015-05-26T20:45:20Z","git_url":"git://github.com/hughsie/colord-gtk.git","ssh_url":"git@github.com:hughsie/colord-gtk.git","clone_url":"https://github.com/hughsie/colord-gtk.git","svn_url":"https://github.com/hughsie/colord-gtk","homepage":null,"size":241,"stargazers_count":3,"watchers_count":3,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hughsie/colord-gtk/pulls/2"},"html":{"href":"https://github.com/hughsie/colord-gtk/pull/2"},"issue":{"href":"https://api.github.com/repos/hughsie/colord-gtk/issues/2"},"comments":{"href":"https://api.github.com/repos/hughsie/colord-gtk/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/hughsie/colord-gtk/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/hughsie/colord-gtk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hughsie/colord-gtk/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/hughsie/colord-gtk/statuses/bccbb1ceb52cedba89d78abcaa78a4a8478a565e"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"hughsie","id":151380,"avatar_url":"https://avatars.githubusercontent.com/u/151380?v=3","gravatar_id":"","url":"https://api.github.com/users/hughsie","html_url":"https://github.com/hughsie","followers_url":"https://api.github.com/users/hughsie/followers","following_url":"https://api.github.com/users/hughsie/following{/other_user}","gists_url":"https://api.github.com/users/hughsie/gists{/gist_id}","starred_url":"https://api.github.com/users/hughsie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hughsie/subscriptions","organizations_url":"https://api.github.com/users/hughsie/orgs","repos_url":"https://api.github.com/users/hughsie/repos","events_url":"https://api.github.com/users/hughsie/events{/privacy}","received_events_url":"https://api.github.com/users/hughsie/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":1,"additions":5,"deletions":3,"changed_files":1}}