ChimeraCoder / anaconda

A Go client library for the Twitter 1.1 API
MIT License
1.14k stars 247 forks source link

Fixes memory leak in decodeResponse() #195

Closed carbocation closed 7 years ago

carbocation commented 7 years ago

The function decodeResponse() in twitter.go did not close the response body in all circumstances. Closure of Response.Body is required as per net/http, even when the body is not used.

On my long-running server-side app, this led to infinite memory growth over time.

ChimeraCoder commented 7 years ago

Mind rebasing this onto master (or checking the box that gives maintainers write access, so I can do taht for you)? Thanks!

carbocation commented 7 years ago

From what I can see, the "allow edits from maintainers" box is already checked. If it's not working, I can also rebase when I get home (may be ~36h from now, hooray physicians' hours).