[ThinLTO] Release files read when creating combined index in gold plugin
[oota-llvm.git] / tools / gold / gold-plugin.cpp
index 08ff45d45ebb8724eadee641c432ed47897f27f4..9f8b0b20f613883d3ee354379eaa6c3cb2c6ab56 100644 (file)
@@ -919,6 +919,9 @@ static ld_plugin_status allSymbolsReadHook(raw_fd_ostream *ApiFile) {
         continue;
 
       CombinedIndex.mergeFrom(std::move(Index), ++NextModuleId);
+
+      if (release_input_file(F.handle) != LDPS_OK)
+        message(LDPL_FATAL, "Failed to release file information");
     }
 
     std::error_code EC;