]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
rewrite close_logs so it could possibly work
authorRoger Dingledine <arma@torproject.org>
Sat, 18 Oct 2003 00:07:58 +0000 (00:07 +0000)
committerRoger Dingledine <arma@torproject.org>
Sat, 18 Oct 2003 00:07:58 +0000 (00:07 +0000)
remove deadbeef memory-clobber testing (for now)

svn:r616

src/common/log.c
src/common/util.c

index faa8f64891a660045ad0b1a2a31f186a43534940..3a60d0576da26e97d24ea2eda4823a727f314bdb 100644 (file)
@@ -116,14 +116,14 @@ void _log_fn(int severity, const char *fn, const char *format, ...)
 
 void close_logs()
 {
-  logfile_t *next, *lf;
-  for (lf = logfiles; lf; lf = lf->next) {
-    if (lf->needs_close)
-      fclose(lf->file);
-    next = lf->next;
-    free(lf);
+  logfile_t *victim;
+  while(logfiles) {
+    victim = logfiles;
+    logfiles = logfiles->next;
+    if (victim->needs_close)
+      fclose(victim->file);
+    free(victim);
   }
-  logfiles = NULL;
 }
 
 void reset_logs()
index 5f7a6017de904022357be7b65d2e11488fb89d2f..333cd65e6e08f560f82c4089dc72839f876d5d23 100644 (file)
@@ -21,7 +21,7 @@ void *tor_malloc(size_t size) {
     log_fn(LOG_ERR, "Out of memory. Dying.");
     exit(1);
   }
-  memset(result,'X',size); /* XXX deadbeef to encourage bugs */
+//  memset(result,'X',size); /* deadbeef to encourage bugs */
   return result;
 }