snapd: Missing Unlock before return in package daemon, func sysInfo
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snappy |
Fix Released
|
Undecided
|
Maciej Borzecki |
Bug Description
In snapd in package daemon in func sysInfo in api.go :
Before line 272 : https:/
... a st.Unlock() is missing before returning the error
code:
L267 st.Lock()
L268 nextRefresh := snapMgr.
L269 lastRefresh, _ := snapMgr.
L270 refreshScheduleStr, err := snapMgr.
L271 if err != nil {
L272 return InternalError(
L273 }
L274 users, err := auth.Users(st)
L275 st.Unlock()
I must admit that I had not looked deeper into the code, I was just reading source code, and the missing st.Unlock is necessary to release the resource.
Changed in snappy: | |
status: | In Progress → Fix Committed |
Changed in snappy: | |
status: | Fix Committed → Fix Released |
Thanks for the report. I've opened a PR addressing this: https:/ /github. com/snapcore/ snapd/pull/ 4520