Skip to content

Commit f7bda73

Browse files
committed
Fix file handle leak
1 parent 711630d commit f7bda73

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

modules/auxiliary/scanner/http/http_traversal.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,7 @@ def is_writable(trigger)
332332
# This is used in the lfi_download() function
333333
#
334334
def load_filelist
335-
f = File.open(datastore['FILELIST'], 'rb')
336-
buf = f.read
337-
f.close
338-
return buf
335+
File.open(datastore['FILELIST'], 'rb') {|f| buf = f.read}
339336
end
340337

341338
def run_host(ip)

0 commit comments

Comments
 (0)