NULL sinks_ after deletion to prevent dangling pointer
authorAndy Ying <andy@trailofbits.com>
Sun, 11 Sep 2016 05:16:32 +0000 (01:16 -0400)
committerAndy Ying <andy@trailofbits.com>
Sun, 11 Sep 2016 05:16:32 +0000 (01:16 -0400)
src/logging.cc

index ec9eef1b83dacc36cfde82d40498de0bd42b722a..0b5e6ee97272cd5df4979e2c290db36bb8d62c79 100644 (file)
@@ -825,6 +825,7 @@ void LogDestination::DeleteLogDestinations() {
   }
   MutexLock l(&sink_mutex_);
   delete sinks_;
+  sinks_ = NULL;
 }
 
 namespace {