rewrite close_logs so it could possibly work

remove deadbeef memory-clobber testing (for now)


svn:r616
This commit is contained in:
Roger Dingledine
2003-10-18 00:07:58 +00:00
parent 96f47a3eca
commit 82aa621b47
2 changed files with 8 additions and 8 deletions
+7 -7
View 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()
+1 -1
View 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;
}