Bug 1385563 - Resource leak - Close the file descriptor r?ted
MozReview-Commit-ID: Kxl6lEFGsUH
--- 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/