Bug 1385563 - Resource leak - Close the file descriptor r?ted draft
authorSylvestre Ledru <sledru@mozilla.com>
Sat, 29 Jul 2017 12:40:21 +0200
changeset 645015 26f1a2a81007f16bb5212a8d8b6d8728ccb4a6ce
parent 616717 082edbab99d3da98cd50542ed189c3ebeec91d55
child 725787 5e73a976c6c85f99425274856acc901194c07bce
push id73630
push userbmo:sledru@mozilla.com
push dateFri, 11 Aug 2017 18:58:15 +0000
reviewersted
bugs1385563
milestone56.0a1
Bug 1385563 - Resource leak - Close the file descriptor r?ted MozReview-Commit-ID: Kxl6lEFGsUH
toolkit/crashreporter/client/crashreporter_unix_common.cpp
--- a/toolkit/crashreporter/client/crashreporter_unix_common.cpp
+++ b/toolkit/crashreporter/client/crashreporter_unix_common.cpp
@@ -50,16 +50,18 @@ void UIPruneSavedDumps(const std::string
       return;
     }
 
     fd.timestamp = st.st_mtime;
 
     dumpfiles.push_back(fd);
   }
 
+  closedir(dirfd);
+
   sort(dumpfiles.begin(), dumpfiles.end(), CompareFDTime);
 
   while (dumpfiles.size() > kSaveCount) {
     // get the path of the oldest file
     string path = dumpfiles[dumpfiles.size() - 1].path;
     UIDeleteFile(path.c_str());
 
     // s/.dmp/.extra/