Bug 1406845 - AddMesaSysfsPaths: Resource leak on dir. r=gcp, a=ritu
authorSylvestre Ledru <sledru@mozilla.com>
Mon, 09 Oct 2017 09:29:29 +0200
changeset 432372 142a0743821ce1aba3aa0ecf3e3de3f16b614691
parent 432371 a6373996bfa6c22cbf5a7895cf35cd036f4c9ea1
child 432373 dcaaba0bd014d430b63a2cd79cc7c926b8f35db6
push id7946
push userryanvm@gmail.com
push dateWed, 11 Oct 2017 17:47:53 +0000
treeherdermozilla-beta@465b880a2af9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgcp, ritu
bugs1406845
milestone57.0
Bug 1406845 - AddMesaSysfsPaths: Resource leak on dir. r=gcp, a=ritu MozReview-Commit-ID: 3ul84cttRAF
security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp
--- a/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp
+++ b/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp
@@ -76,16 +76,17 @@ AddMesaSysfsPaths(SandboxBroker::Policy*
             if (realSysPath) {
               nsPrintfCString ueventPath("%s/uevent", realSysPath.get());
               aPolicy->AddPath(rdonly, ueventPath.get());
             }
           }
         }
       }
     }
+    closedir(dir);
   }
 }
 
 SandboxBrokerPolicyFactory::SandboxBrokerPolicyFactory()
 {
   // Policy entries that are the same in every process go here, and
   // are cached over the lifetime of the factory.
 #if defined(MOZ_CONTENT_SANDBOX)