Commit 82aa621b authored by Roger Dingledine's avatar Roger Dingledine
Browse files

rewrite close_logs so it could possibly work

remove deadbeef memory-clobber testing (for now)


svn:r616
parent 96f47a3e
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -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()
+1 −1
Original line number Diff line number Diff line
@@ -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;
}