{"action":"created","issue":{"url":"https://api.github.com/repos/caolan/async/issues/552","labels_url":"https://api.github.com/repos/caolan/async/issues/552/labels{/name}","comments_url":"https://api.github.com/repos/caolan/async/issues/552/comments","events_url":"https://api.github.com/repos/caolan/async/issues/552/events","html_url":"https://github.com/caolan/async/issues/552","id":35673715,"number":552,"title":"Question: Does this leak resources?","user":{"login":"mattlandis","id":708286,"avatar_url":"https://avatars.githubusercontent.com/u/708286?v=3","gravatar_id":"","url":"https://api.github.com/users/mattlandis","html_url":"https://github.com/mattlandis","followers_url":"https://api.github.com/users/mattlandis/followers","following_url":"https://api.github.com/users/mattlandis/following{/other_user}","gists_url":"https://api.github.com/users/mattlandis/gists{/gist_id}","starred_url":"https://api.github.com/users/mattlandis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattlandis/subscriptions","organizations_url":"https://api.github.com/users/mattlandis/orgs","repos_url":"https://api.github.com/users/mattlandis/repos","events_url":"https://api.github.com/users/mattlandis/events{/privacy}","received_events_url":"https://api.github.com/users/mattlandis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2014-06-13T14:00:03Z","updated_at":"2015-01-19T23:13:05Z","closed_at":null,"body":"Ran across a case in our code where someone had done this.   The correct thing would be to call callback instead of next. I was just curious if it leaked resources or if garbage collection would eventually clean this up?\r\n\r\n```javascript\r\n\r\nfunction func2(callback) {\r\n  if (sometest()) {\r\n     return next(new MyError());  // Should be callback here.\r\n  }\r\n  callback();\r\n}\r\n\r\nfunction handler(req, res, next) {\r\n  async.waterfall([\r\n    func1,\r\n    func2,\r\n    func3], next);\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/caolan/async/issues/comments/70577709","html_url":"https://github.com/caolan/async/issues/552#issuecomment-70577709","issue_url":"https://api.github.com/repos/caolan/async/issues/552","id":70577709,"user":{"login":"aearly","id":558190,"avatar_url":"https://avatars.githubusercontent.com/u/558190?v=3","gravatar_id":"","url":"https://api.github.com/users/aearly","html_url":"https://github.com/aearly","followers_url":"https://api.github.com/users/aearly/followers","following_url":"https://api.github.com/users/aearly/following{/other_user}","gists_url":"https://api.github.com/users/aearly/gists{/gist_id}","starred_url":"https://api.github.com/users/aearly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aearly/subscriptions","organizations_url":"https://api.github.com/users/aearly/orgs","repos_url":"https://api.github.com/users/aearly/repos","events_url":"https://api.github.com/users/aearly/events{/privacy}","received_events_url":"https://api.github.com/users/aearly/received_events","type":"User","site_admin":false},"created_at":"2015-01-19T23:13:05Z","updated_at":"2015-01-19T23:13:05Z","body":"Here's a test case that leaks about ~650k of memory:  http://requirebin.com/?gist=fe483795802d62f32013\r\n\r\nTurn on profiling, trigger GC, click Run, then trigger GC again."}}