Skip to content

Commit

Permalink
Merge pull request #65 from AngelRefael/master
Browse files Browse the repository at this point in the history
Update event.go - fix a memory leak
  • Loading branch information
lfepp authored Feb 8, 2017
2 parents fad777c + 7b5d2b8 commit cea33b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion event.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ func CreateEvent(e Event) (*EventResponse, error) {
if err != nil {
return nil, err
}
defer resp.Body.Close()
if resp.StatusCode != http.StatusOK {
return nil, fmt.Errorf("HTTP Status Code: %d", resp.StatusCode)
}
var eventResponse EventResponse
defer resp.Body.Close()
if err := json.NewDecoder(resp.Body).Decode(&eventResponse); err != nil {
return nil, err
}
Expand Down

0 comments on commit cea33b0

Please sign in to comment.