summaryrefslogtreecommitdiff
path: root/profiles
diff options
context:
space:
mode:
authorallencloud <allen.sun@daocloud.io>2016-06-25 11:57:21 +0800
committerallencloud <allen.sun@daocloud.io>2016-08-10 08:36:09 +0800
commit0ead624473b6bddc232b46bc7c76ab4f9c743ff5 (patch)
tree9dff0a54586c16ec8b0071e5413f3c2010b04557 /profiles
parent2684459ed433125257ffde5e95666ff785f26ec2 (diff)
downloaddocker-0ead624473b6bddc232b46bc7c76ab4f9c743ff5.tar.gz
add defer file.Close to avoid potential fd leak
Signed-off-by: allencloud <allen.sun@daocloud.io>
Diffstat (limited to 'profiles')
-rw-r--r--profiles/apparmor/apparmor.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/profiles/apparmor/apparmor.go b/profiles/apparmor/apparmor.go
index 51dfa5cf9c..115e43842d 100644
--- a/profiles/apparmor/apparmor.go
+++ b/profiles/apparmor/apparmor.go
@@ -102,6 +102,8 @@ func IsLoaded(name string) error {
if err != nil {
return err
}
+ defer file.Close()
+
r := bufio.NewReader(file)
for {
p, err := r.ReadString('\n')