mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
rewrite close_logs so it could possibly work
remove deadbeef memory-clobber testing (for now) svn:r616
This commit is contained in:
+7
-7
@@ -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
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user