{"action":"created","issue":{"url":"https://api.github.com/repos/performancecopilot/pcp/issues/56","labels_url":"https://api.github.com/repos/performancecopilot/pcp/issues/56/labels{/name}","comments_url":"https://api.github.com/repos/performancecopilot/pcp/issues/56/comments","events_url":"https://api.github.com/repos/performancecopilot/pcp/issues/56/events","html_url":"https://github.com/performancecopilot/pcp/issues/56","id":121803003,"number":56,"title":"Memory leak detected by Valgrind","user":{"login":"e03213ac","id":16261383,"avatar_url":"https://avatars.githubusercontent.com/u/16261383?v=3","gravatar_id":"","url":"https://api.github.com/users/e03213ac","html_url":"https://github.com/e03213ac","followers_url":"https://api.github.com/users/e03213ac/followers","following_url":"https://api.github.com/users/e03213ac/following{/other_user}","gists_url":"https://api.github.com/users/e03213ac/gists{/gist_id}","starred_url":"https://api.github.com/users/e03213ac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/e03213ac/subscriptions","organizations_url":"https://api.github.com/users/e03213ac/orgs","repos_url":"https://api.github.com/users/e03213ac/repos","events_url":"https://api.github.com/users/e03213ac/events{/privacy}","received_events_url":"https://api.github.com/users/e03213ac/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-12-11T22:17:40Z","updated_at":"2015-12-15T03:47:43Z","closed_at":"2015-12-15T03:47:43Z","body":"This Valgrind error was generated on 3.10.8 but it also applies to the latest master branch:\r\n\r\n    ==109671== 5 bytes in 1 blocks are definitely lost in loss record 1 of 6\r\n    ==109671==    at 0x4C27A2E: malloc (vg_replace_malloc.c:270)\r\n    ==109671==    by 0x505ACB3: DecodeNameReq (p_pmns.c:519)\r\n    ==109671==    by 0x4E37247: __pmdaMainPDU (mainloop.c:232)\r\n    ==109671==    by 0x4E378C7: pmdaMain (mainloop.c:428)\r\n    ==109671==    by 0x402A34: main (fbit_main.c:271)\r\n\r\nThe problem is in `src/libpcp_pmda/src/mainloop.c`, line 232:\r\n\r\n    if ((sts = __pmDecodeChildReq(pb, &name, &subtype)) >= 0) {\r\n\r\nThe `name` string is not freed.\r\n\r\nSuggested patch:\r\n\r\n    diff --git a/src/libpcp_pmda/src/mainloop.c b/src/libpcp_pmda/src/mainloop.c\r\n    index 5dff1a9..b900b72 100644\r\n    --- a/src/libpcp_pmda/src/mainloop.c\r\n    +++ b/src/libpcp_pmda/src/mainloop.c\r\n    @@ -243,6 +243,7 @@ __pmdaMainPDU(pmdaInterface *dispatch)\r\n                    /* Not INTERFACE_4 */\r\n                    sts = PM_ERR_NAME;\r\n                }\r\n    +           free(name);\r\n            }\r\n            if (sts < 0)\r\n                __pmSendError(pmda->e_outfd, FROM_ANON, sts);\r\n"},"comment":{"url":"https://api.github.com/repos/performancecopilot/pcp/issues/comments/164636742","html_url":"https://github.com/performancecopilot/pcp/issues/56#issuecomment-164636742","issue_url":"https://api.github.com/repos/performancecopilot/pcp/issues/56","id":164636742,"user":{"login":"kmcdonell","id":4628395,"avatar_url":"https://avatars.githubusercontent.com/u/4628395?v=3","gravatar_id":"","url":"https://api.github.com/users/kmcdonell","html_url":"https://github.com/kmcdonell","followers_url":"https://api.github.com/users/kmcdonell/followers","following_url":"https://api.github.com/users/kmcdonell/following{/other_user}","gists_url":"https://api.github.com/users/kmcdonell/gists{/gist_id}","starred_url":"https://api.github.com/users/kmcdonell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kmcdonell/subscriptions","organizations_url":"https://api.github.com/users/kmcdonell/orgs","repos_url":"https://api.github.com/users/kmcdonell/repos","events_url":"https://api.github.com/users/kmcdonell/events{/privacy}","received_events_url":"https://api.github.com/users/kmcdonell/received_events","type":"User","site_admin":false},"created_at":"2015-12-15T03:47:43Z","updated_at":"2015-12-15T03:47:43Z","body":"Fixed in commit a6cb593\r\n\r\nThanks Emanuele."}}