fix file descriptor leak of ".../ip_local_port_range"
fix file descriptor leak of "/proc/sys/net/ipv4/ip_local_port_range"
This commit is contained in:
parent
4a8b4af8af
commit
f88ad7d340
1 changed files with 3 additions and 0 deletions
|
@ -108,6 +108,9 @@ func getDynamicPortRange() (start int, end int, err error) {
|
|||
if err != nil {
|
||||
return 0, 0, fmt.Errorf("port allocator - %s due to error: %v", portRangeFallback, err)
|
||||
}
|
||||
|
||||
defer file.Close()
|
||||
|
||||
n, err := fmt.Fscanf(bufio.NewReader(file), "%d\t%d", &start, &end)
|
||||
if n != 2 || err != nil {
|
||||
if err == nil {
|
||||
|
|
Loading…
Add table
Reference in a new issue