From e6a34c02e8ad649cf7bd182f08726aedccf6ec7d Mon Sep 17 00:00:00 2001 From: Christian Hofstaedtler Date: Tue, 1 Apr 2014 12:06:19 +0200 Subject: [PATCH] Initialize AddressFamily for slave sockets Fixes Coverity CID 727958. --- pdns/sstuff.hh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pdns/sstuff.hh b/pdns/sstuff.hh index 40aa53d9c5..e77887ddce 100644 --- a/pdns/sstuff.hh +++ b/pdns/sstuff.hh @@ -39,8 +39,9 @@ typedef int ProtocolType; //!< Supported protocol types class Socket : public boost::noncopyable { private: - explicit Socket(int fd) + explicit Socket(int fd, AddressFamily af) { + d_family=af; d_buflen=4096; d_buffer=new char[d_buflen]; d_socket=fd; @@ -78,7 +79,7 @@ public: throw NetworkError("Accepting a connection: "+string(strerror(errno))); } - return new Socket(s); + return new Socket(s, d_family); } //! Set the socket to non-blocking @@ -326,7 +327,7 @@ private: int d_socket; char *d_buffer; int d_buflen; - int d_family; + AddressFamily d_family; }; -- 2.47.2