]> granicus.if.org Git - pdns/commitdiff
ixfrdist: Prevent a nullptr exception
authorPieter Lexis <pieter.lexis@powerdns.com>
Wed, 14 Feb 2018 10:00:54 +0000 (11:00 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Wed, 14 Feb 2018 10:00:54 +0000 (11:00 +0100)
pdns/ixfrdist.cc

index a0465633e7dc634bf4deaca13fa91b6cbac85ee3..d8d4150dec2c0b3da1a7ef39bf099ae6f1d13f39 100644 (file)
@@ -260,16 +260,16 @@ void updateThread() {
         if (g_verbose) {
           cerr<<"[INFO] Wrote zonedata for "<<domain<<" with serial "<<soa->d_st.serial<<" to "<<dir<<endl;
         }
+        {
+          std::lock_guard<std::mutex> guard(g_soas_mutex);
+          g_soas[domain] = soa;
+        }
+
       } catch (ResolverException &e) {
         cerr<<"[WARNING] Could not retrieve AXFR for '"<<domain<<"': "<<e.reason<<endl;
       } catch (runtime_error &e) {
         cerr<<"[WARNING] Could not save zone '"<<domain<<"' to disk: "<<e.what()<<endl;
       }
-      {
-        std::lock_guard<std::mutex> guard(g_soas_mutex);
-        g_soas[domain] = soa;
-      }
-
       // Now clean up the directory
       cleanUpDomain(domain);
     } /* for (const auto &domain : domains) */