]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
fix possible fd leak in signpipe worker 1687/head
authorKees Monshouwer <mind04@monshouwer.org>
Sun, 31 Aug 2014 19:04:03 +0000 (21:04 +0200)
committermind04 <mind04@monshouwer.org>
Sun, 31 Aug 2014 21:21:32 +0000 (23:21 +0200)
pdns/signingpipe.cc

index bb164e34055e640d689c72fe59d6116d4d78cd66..0756149f3848ad46de9f4d608d7915ad20e8593e 100644 (file)
@@ -62,11 +62,8 @@ try
   shs.d_csp->worker(shs.d_id, shs.d_fd);
   return 0;
 }
-catch(PDNSException& pe) {
-  L<<Logger::Error<<"Signing thread died with error "<<pe.reason<<endl;
-}
-catch(std::exception& e) {
-  L<<Logger::Error<<"Signing thread died with error "<<e.what()<<endl;
+catch(...) {
+  L<<Logger::Error<<"unknown exception in signing thread occurred"<<endl;
   return 0;
 }
 
@@ -303,6 +300,11 @@ try
   }
   close(fd);
 }
+catch(PDNSException& pe)
+{
+  L<<Logger::Error<<"Signing thread died because of PDNSException: "<<pe.reason<<endl;
+  close(fd);
+}
 catch(std::exception& e)
 {
   L<<Logger::Error<<"Signing thread died because of std::exception: "<<e.what()<<endl;