From: Christian Hofstaedtler Date: Tue, 1 Apr 2014 10:06:19 +0000 (+0200) Subject: Initialize AddressFamily for slave sockets X-Git-Tag: rec-3.6.0-rc1~107^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e6a34c02e8ad649cf7bd182f08726aedccf6ec7d;p=thirdparty%2Fpdns.git Initialize AddressFamily for slave sockets Fixes Coverity CID 727958. --- 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; };