From 732d9faaa6cfa3c3aece32b2dc7c535d43251338 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Tue, 29 Sep 2015 20:31:47 +0300 Subject: [PATCH] Close d_sock when DNSProxy goes away fix cid#1029928 --- pdns/dnsproxy.cc | 5 +++++ pdns/dnsproxy.hh | 1 + 2 files changed, 6 insertions(+) diff --git a/pdns/dnsproxy.cc b/pdns/dnsproxy.cc index d889e9889..4d8858d44 100644 --- a/pdns/dnsproxy.cc +++ b/pdns/dnsproxy.cc @@ -301,3 +301,8 @@ void DNSProxy::mainloop(void) L<-1) closesocket(d_sock); + d_sock=-1; +} diff --git a/pdns/dnsproxy.hh b/pdns/dnsproxy.hh index c48dec712..b842c5dce 100644 --- a/pdns/dnsproxy.hh +++ b/pdns/dnsproxy.hh @@ -52,6 +52,7 @@ class DNSProxy { public: DNSProxy(const string &ip); //!< creates socket + ~DNSProxy(); //