{"action":"opened","issue":{"url":"https://api.github.com/repos/lionheart/openradar-mirror/issues/15441","repository_url":"https://api.github.com/repos/lionheart/openradar-mirror","labels_url":"https://api.github.com/repos/lionheart/openradar-mirror/issues/15441/labels{/name}","comments_url":"https://api.github.com/repos/lionheart/openradar-mirror/issues/15441/comments","events_url":"https://api.github.com/repos/lionheart/openradar-mirror/issues/15441/events","html_url":"https://github.com/lionheart/openradar-mirror/issues/15441","id":167140877,"number":15441,"title":"27501834: NSURLSession Leaks During client authentication","user":{"login":"openradar-mirror","id":13605213,"avatar_url":"https://avatars.githubusercontent.com/u/13605213?v=3","gravatar_id":"","url":"https://api.github.com/users/openradar-mirror","html_url":"https://github.com/openradar-mirror","followers_url":"https://api.github.com/users/openradar-mirror/followers","following_url":"https://api.github.com/users/openradar-mirror/following{/other_user}","gists_url":"https://api.github.com/users/openradar-mirror/gists{/gist_id}","starred_url":"https://api.github.com/users/openradar-mirror/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openradar-mirror/subscriptions","organizations_url":"https://api.github.com/users/openradar-mirror/orgs","repos_url":"https://api.github.com/users/openradar-mirror/repos","events_url":"https://api.github.com/users/openradar-mirror/events{/privacy}","received_events_url":"https://api.github.com/users/openradar-mirror/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/lionheart/openradar-mirror/labels/classification:security","name":"classification:security","color":"e11d21"},{"url":"https://api.github.com/repos/lionheart/openradar-mirror/labels/reproducible:always","name":"reproducible:always","color":"5319e7"},{"url":"https://api.github.com/repos/lionheart/openradar-mirror/labels/status:open","name":"status:open","color":"009800"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/lionheart/openradar-mirror/milestones/6","html_url":"https://github.com/lionheart/openradar-mirror/milestones/OS%20X","labels_url":"https://api.github.com/repos/lionheart/openradar-mirror/milestones/6/labels","id":1237420,"number":6,"title":"OS X","description":null,"creator":{"login":"openradar-mirror","id":13605213,"avatar_url":"https://avatars.githubusercontent.com/u/13605213?v=3","gravatar_id":"","url":"https://api.github.com/users/openradar-mirror","html_url":"https://github.com/openradar-mirror","followers_url":"https://api.github.com/users/openradar-mirror/followers","following_url":"https://api.github.com/users/openradar-mirror/following{/other_user}","gists_url":"https://api.github.com/users/openradar-mirror/gists{/gist_id}","starred_url":"https://api.github.com/users/openradar-mirror/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openradar-mirror/subscriptions","organizations_url":"https://api.github.com/users/openradar-mirror/orgs","repos_url":"https://api.github.com/users/openradar-mirror/repos","events_url":"https://api.github.com/users/openradar-mirror/events{/privacy}","received_events_url":"https://api.github.com/users/openradar-mirror/received_events","type":"User","site_admin":false},"open_issues":1402,"closed_issues":4,"state":"open","created_at":"2015-08-03T02:08:32Z","updated_at":"2016-07-22T22:01:32Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2016-07-22T22:01:32Z","updated_at":"2016-07-22T22:01:32Z","closed_at":null,"body":"#### Description\n\nSummary:\r\nNSURLSession's dataTaskWithRequest:completionHandler: leaks when performing a request that invokes URLSession:didReceiveChallenge:completionHandler: for client certificate authentication. A delegate does not even need to be setup to handle the challenge, as seen in the following example. There are no issues with actually getting client authentication working, but the leaks are alarming for long running processes.\r\n\r\nChanging the URL to another site that does not require client authentication results in no leaks.\r\n\r\n  NSURLRequest *req = [NSURLRequest requestWithURL:[NSURL URLWithString:@\"https://clientauth.exaple.com\"]];\r\n  NSURLSession *session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration ephemeralSessionConfiguration]];\r\n  [[session dataTaskWithRequest:req completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {\r\n    NSLog(@\"%@\", response);\r\n  }] resume];\r\n  [session finishTasksAndInvalidate];\r\n\r\nSteps to Reproduce:\r\n1. Run the attached test app through Instruments.\r\n\r\nExpected Results:\r\nThere should be no leaks.\r\n\r\nActual Results:\r\nThe test program leaks:\r\nLeaked Object\t#\tAddress\tSize\tResponsible Library\tResponsible Frame\r\nMalloc 64 Bytes\t1\t0x600000269940\t64 Bytes\tSecurity\tDefaultAllocator::malloc(unsigned long)\r\nMalloc 16 Bytes\t1\t0x600000010430\t16 Bytes\tSecurity\tDefaultAllocator::malloc(unsigned long)\n\n-\nProduct Version: 10.11.6\nCreated: 2016-07-22T21:54:58.360470\nOriginated: 2016-07-22T17:31:00\nOpen Radar Link: http://www.openradar.me/27501834"}}
{"actor":{"display_login":"openradar-mirror"}}