aboutsummaryrefslogtreecommitdiff
path: root/src/or/config.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-03-08 01:11:54 +0000
committerNick Mathewson <nickm@torproject.org>2008-03-08 01:11:54 +0000
commit7587e167962813342688310783fedc69d7504519 (patch)
treebfe09c2e82c57a2cc5397b0d9adba300d3970dac /src/or/config.c
parent267527661805de16946b39e88c986f827604be20 (diff)
downloadtor-7587e167962813342688310783fedc69d7504519.tar
tor-7587e167962813342688310783fedc69d7504519.tar.gz
r18639@catbus: nickm | 2008-03-07 20:11:48 -0500
Change semantics of add-a-log functions to copy severity setup: that is way less error-prone. Fix up config.c to act accordingly. svn:r13888
Diffstat (limited to 'src/or/config.c')
-rw-r--r--src/or/config.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/or/config.c b/src/or/config.c
index fc6e4e822..123fe1d9b 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -1055,6 +1055,7 @@ options_act_reversible(or_options_t *old_options, char **msg)
close_temp_logs();
add_callback_log(severity, control_event_logmsg);
control_adjust_event_log_severity();
+ tor_free(severity);
}
SMARTLIST_FOREACH(replaced_listeners, connection_t *, conn,
{
@@ -3770,7 +3771,6 @@ options_init_logs(or_options_t *options, int validate_only)
} else {
add_stream_log(severity, err?"<stderr>":"<stdout>",
err?stderr:stdout);
- severity=NULL;
}
}
goto cleanup;
@@ -3780,7 +3780,6 @@ options_init_logs(or_options_t *options, int validate_only)
#ifdef HAVE_SYSLOG_H
if (!validate_only) {
add_syslog_log(severity);
- severity=NULL;
}
#else
log_warn(LD_CONFIG, "Syslog is not supported on this system. Sorry.");
@@ -3794,8 +3793,6 @@ options_init_logs(or_options_t *options, int validate_only)
if (add_file_log(severity, smartlist_get(elts, 1)) < 0) {
log_warn(LD_CONFIG, "Couldn't open file for 'Log %s'", opt->value);
ok = 0;
- } else {
- tor_free(severity);
}
}
goto cleanup;