Skip to content

Commit

Permalink
fixed #712
Browse files Browse the repository at this point in the history
  • Loading branch information
IrineSistiana committed Sep 17, 2023
1 parent f02d377 commit 4105aa0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions plugin/executable/nftset/nftset_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ package nftset
import (
"context"
"fmt"
"net/netip"

"github.com/IrineSistiana/mosdns/v5/pkg/nftset_utils"
"github.com/IrineSistiana/mosdns/v5/pkg/query_context"
"github.com/IrineSistiana/mosdns/v5/pkg/utils"
"github.com/google/nftables"
"github.com/miekg/dns"
"net/netip"
)

type nftSetPlugin struct {
Expand Down Expand Up @@ -138,8 +139,12 @@ func (p *nftSetPlugin) addElems(r *dns.Msg) error {
}

func (p *nftSetPlugin) Close() error {
_ = p.v6Handler.Close()
_ = p.v4Handler.Close()
if p.v4Handler != nil {
_ = p.v4Handler.Close()
}
if p.v6Handler != nil {
_ = p.v6Handler.Close()
}
return nil
}

Expand Down

0 comments on commit 4105aa0

Please sign in to comment.