{"action":"created","issue":{"url":"https://api.github.com/repos/openssl/openssl/issues/1034","repository_url":"https://api.github.com/repos/openssl/openssl","labels_url":"https://api.github.com/repos/openssl/openssl/issues/1034/labels{/name}","comments_url":"https://api.github.com/repos/openssl/openssl/issues/1034/comments","events_url":"https://api.github.com/repos/openssl/openssl/issues/1034/events","html_url":"https://github.com/openssl/openssl/pull/1034","id":153496486,"number":1034,"title":"fix BN_hex2bn()/BN_dec2bn() memory leak","user":{"login":"huangqinjin","id":8402260,"avatar_url":"https://avatars.githubusercontent.com/u/8402260?v=3","gravatar_id":"","url":"https://api.github.com/users/huangqinjin","html_url":"https://github.com/huangqinjin","followers_url":"https://api.github.com/users/huangqinjin/followers","following_url":"https://api.github.com/users/huangqinjin/following{/other_user}","gists_url":"https://api.github.com/users/huangqinjin/gists{/gist_id}","starred_url":"https://api.github.com/users/huangqinjin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huangqinjin/subscriptions","organizations_url":"https://api.github.com/users/huangqinjin/orgs","repos_url":"https://api.github.com/users/huangqinjin/repos","events_url":"https://api.github.com/users/huangqinjin/events{/privacy}","received_events_url":"https://api.github.com/users/huangqinjin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/openssl/openssl/milestones/1","html_url":"https://github.com/openssl/openssl/milestones/1.1.0","labels_url":"https://api.github.com/repos/openssl/openssl/milestones/1/labels","id":1748232,"number":1,"title":"1.1.0","description":"","creator":{"login":"levitte","id":698918,"avatar_url":"https://avatars.githubusercontent.com/u/698918?v=3","gravatar_id":"","url":"https://api.github.com/users/levitte","html_url":"https://github.com/levitte","followers_url":"https://api.github.com/users/levitte/followers","following_url":"https://api.github.com/users/levitte/following{/other_user}","gists_url":"https://api.github.com/users/levitte/gists{/gist_id}","starred_url":"https://api.github.com/users/levitte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/levitte/subscriptions","organizations_url":"https://api.github.com/users/levitte/orgs","repos_url":"https://api.github.com/users/levitte/repos","events_url":"https://api.github.com/users/levitte/events{/privacy}","received_events_url":"https://api.github.com/users/levitte/received_events","type":"User","site_admin":false},"open_issues":46,"closed_issues":25,"state":"open","created_at":"2016-05-04T17:53:39Z","updated_at":"2016-05-18T09:49:35Z","due_on":"2016-05-11T22:00:00Z","closed_at":null},"comments":8,"created_at":"2016-05-06T17:11:25Z","updated_at":"2016-05-18T10:15:25Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/openssl/openssl/pulls/1034","html_url":"https://github.com/openssl/openssl/pull/1034","diff_url":"https://github.com/openssl/openssl/pull/1034.diff","patch_url":"https://github.com/openssl/openssl/pull/1034.patch"},"body":"```c\r\nBIGNUM* n = NULL;\r\nif (BN_hex2bn(&n, \"g\")){\r\n    ...\r\n    BN_free(n);\r\n}\r\nelse{\r\n     // error handling\r\n}\r\n```\r\n  According to returned error code(0), we need to handle the error and generally expect that n is still NULL so that we don't need call to BN_free(), but we are disappointed and may cause potential memory leak. In additionI, \"-g\" isn't a valid hex string but `BN_hex2bn(&n, \"-g\")` returns 1 and eats the char '-'.\r\n\r\n  This fix may be a breaking change for someone?!"},"comment":{"url":"https://api.github.com/repos/openssl/openssl/issues/comments/219984580","html_url":"https://github.com/openssl/openssl/pull/1034#issuecomment-219984580","issue_url":"https://api.github.com/repos/openssl/openssl/issues/1034","id":219984580,"user":{"login":"mattcaswell","id":7422273,"avatar_url":"https://avatars.githubusercontent.com/u/7422273?v=3","gravatar_id":"","url":"https://api.github.com/users/mattcaswell","html_url":"https://github.com/mattcaswell","followers_url":"https://api.github.com/users/mattcaswell/followers","following_url":"https://api.github.com/users/mattcaswell/following{/other_user}","gists_url":"https://api.github.com/users/mattcaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/mattcaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattcaswell/subscriptions","organizations_url":"https://api.github.com/users/mattcaswell/orgs","repos_url":"https://api.github.com/users/mattcaswell/repos","events_url":"https://api.github.com/users/mattcaswell/events{/privacy}","received_events_url":"https://api.github.com/users/mattcaswell/received_events","type":"User","site_admin":false},"created_at":"2016-05-18T10:15:24Z","updated_at":"2016-05-18T10:15:24Z","body":"Looks good to me.\r\n\r\n+1"}}