]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Don't unlock a new log until done logging the tor version.
authorNick Mathewson <nickm@torproject.org>
Mon, 25 Jan 2010 19:09:18 +0000 (14:09 -0500)
committerNick Mathewson <nickm@torproject.org>
Mon, 25 Jan 2010 19:09:18 +0000 (14:09 -0500)
This might please coverity scan.

src/common/log.c

index ef65be8a3d4fb90840b80eaeeea5a18dd2a11108..dfea58f47cef225e380fa6bb1865b928bfeb8433 100644 (file)
@@ -678,13 +678,11 @@ add_file_log(const log_severity_list_t *severity, const char *filename)
   logfiles->needs_close = 1;
   lf = logfiles;
   _log_global_min_severity = get_min_log_level();
-  UNLOCK_LOGS();
 
   if (log_tor_version(lf, 0) < 0) {
-    LOCK_LOGS();
     delete_log(lf);
-    UNLOCK_LOGS();
   }
+  UNLOCK_LOGS();
 
   return 0;
 }