Skip to content

Commit

Permalink
fix memory leak
Browse files Browse the repository at this point in the history
Signed-off-by: Jianwei Mao <maojianwei2016@126.com>
  • Loading branch information
MaoJianwei authored Sep 12, 2024
1 parent 9574f0d commit e231208
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions incubator/OnosTopoShow/onos-topo-module.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ func sendRequest(method string, url string, body []byte) bool {

client := http.Client{}
resp, err := client.Do(req)
defer resp.Body.Close()

if err != nil {
util.MaoLogM(util.WARN, MODULE_NAME, "Fail to do request: %s %s, err: %s",
req.Method, req.URL.String(), err.Error())
Expand Down

0 comments on commit e231208

Please sign in to comment.