Fix file descriptor leak in Formula#system

This commit is contained in:
Jack Nagel 2013-09-06 23:17:50 -05:00
parent 77b5805fda
commit a1f165c02d

View File

@ -591,7 +591,7 @@ class Formula
rescue ErrorDuringExecution
raise BuildError.new(self, cmd, args, $?)
ensure
f.close if f and not f.closed?
[rd, f].each { |io| io.close if io and not io.closed? }
ENV.update(removed_ENV_variables) if removed_ENV_variables
end