github-vet / github-vet/rangeloop-pointer-findings
chuan717/gopub: src/tasks/check_p2p_agent.go; 17 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [chuan717/gopub](https://www.github.com/chuan717/gopub) at [src/tasks/check_p2p_agent.go](https://github.com/chuan717/gopub/blob/5b38181e7e8a152fd5e075cc5c0f4086af645688/src/tasks/check_p2p_agent.go#L30-L46)
Below is the message reported by the analyzer for this snippet of code. Beware that the analyzer only reports the first
issue it finds, so please do not limit your consideration to the contents of the below message.
> function call at line 32 may store a reference to project
[Click here to see the code in its original context.](https://github.com/chuan717/gopub/blob/5b38181e7e8a152fd5e075cc5c0f4086af645688/src/tasks/check_p2p_agent.go#L30-L46)
Click here to show the 17 line(s) of Go which triggered the analyzer.
```go
for _, project := range projects {
s := components.BaseComponents{}
s.SetProject(&project)
s.SetTask(&models.Task{Id: -10})
ips := s.GetHostIps()
ss := init_sever.P2pSvc.CheckAllClient(ips)
reIps := []string{}
for ip, status := range ss {
if status == "dead" {
reIps = append(reIps, strings.Split(ip, ":")[0])
}
}
if len(reIps) > 0 {
AgentDestDir := beego.AppConfig.String("AgentDestDir")
s.StartP2pAgent(reIps, AgentDestDir)
}
}
```
Leave a reaction on this issue to contribute to the project by classifying this instance as a **Bug** :-1:, **Mitigated** :+1:, or **Desirable Behavior** :rocket:
See the descriptions of the classifications [here](https://github.com/github-vet/rangeclosure-findings#how-can-i-help) for more information.
commit ID: 5b38181e7e8a152fd5e075cc5c0f4086af645688
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.