aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-10-18 00:07:58 +0000
committerRoger Dingledine <arma@torproject.org>2003-10-18 00:07:58 +0000
commit82aa621b47018838c9659d34ab34cd6517815daa (patch)
tree765fd68a8b8a57499ff2e5980d8e3c27e72eda14 /src
parent96f47a3eca9723a491f3b551a7b39147cc8c5949 (diff)
downloadtor-82aa621b47018838c9659d34ab34cd6517815daa.tar
tor-82aa621b47018838c9659d34ab34cd6517815daa.tar.gz
rewrite close_logs so it could possibly work
remove deadbeef memory-clobber testing (for now) svn:r616
Diffstat (limited to 'src')
-rw-r--r--src/common/log.c14
-rw-r--r--src/common/util.c2
2 files changed, 8 insertions, 8 deletions
diff --git a/src/common/log.c b/src/common/log.c
index faa8f6489..3a60d0576 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -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()
diff --git a/src/common/util.c b/src/common/util.c
index 5f7a6017d..333cd65e6 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -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;
}