Whamcloud - gitweb
LU-2644 build: fix 'resource leak' errors
[fs/lustre-release.git] / lustre / utils / liblustreapi.c
index bb1c0b6..eefd0ea 100644 (file)
@@ -3111,6 +3111,7 @@ static int rmtacl_notify(int ops)
                 }
 
                 rc = ioctl(fd, LL_IOC_RMTACL, ops);
+               close(fd);
                 if (rc < 0) {
                         rc = -errno;
                         llapi_error(LLAPI_MSG_ERROR, rc, "ioctl %d\n", fd);
@@ -3122,8 +3123,6 @@ static int rmtacl_notify(int ops)
 
 out:
         endmntent(fp);
-       if (fd >= 0)
-               close(fd);
        return ((rc != 0) ? rc : found);
 }