aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2019-08-26 08:25:02 +0000
committerGravatar GitHub <noreply@github.com> 2019-08-26 08:25:02 +0000
commitaeb27bdb5bc836e1871f9db526e6ab8d505d4442 (patch)
tree6e110df07e966d1fb252f79aab615d0aafdd5812 /plugin
parentd4cef05d0f17bfaa97b969ba1bcf63d0d0852fd8 (diff)
downloadcoredns-aeb27bdb5bc836e1871f9db526e6ab8d505d4442.tar.gz
coredns-aeb27bdb5bc836e1871f9db526e6ab8d505d4442.tar.zst
coredns-aeb27bdb5bc836e1871f9db526e6ab8d505d4442.zip
plugin/file: close reader for reload (#3196)
This reloader didn't close the openened file handle. Add a close. Can't use `defer` because this is in a endless loop. Signed-off-by: Miek Gieben <miek@miek.nl>
Diffstat (limited to 'plugin')
-rw-r--r--plugin/file/reload.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/plugin/file/reload.go b/plugin/file/reload.go
index c56d8f37f..79db040fe 100644
--- a/plugin/file/reload.go
+++ b/plugin/file/reload.go
@@ -25,6 +25,7 @@ func (z *Zone) Reload() error {
serial := z.SOASerialIfDefined()
zone, err := Parse(reader, z.origin, zFile, serial)
+ reader.Close()
if err != nil {
if _, ok := err.(*serialErr); !ok {
log.Errorf("Parsing zone %q: %v", z.origin, err)