summaryrefslogtreecommitdiff
path: root/src/or/control.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-01-06 16:29:52 -0500
committerNick Mathewson <nickm@torproject.org>2015-01-06 17:06:55 -0500
commit14dedff0abd8b6b9c1c2766fe0ce5844c77d58ac (patch)
tree3ac0dcf53a14509086aaae57206b8ad75bd59b18 /src/or/control.c
parent9396005428c40cf7ef9f1e6ae1d725f3155391f5 (diff)
downloadtor-14dedff0abd8b6b9c1c2766fe0ce5844c77d58ac.tar.gz
tor-14dedff0abd8b6b9c1c2766fe0ce5844c77d58ac.zip
Drop assumption that get_torrc_fname() can't return NULL.
Diffstat (limited to 'src/or/control.c')
-rw-r--r--src/or/control.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/control.c b/src/or/control.c
index 3dbaa1bdf2..21d2e09856 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -1439,9 +1439,11 @@ getinfo_helper_misc(control_connection_t *conn, const char *question,
if (!strcmp(question, "version")) {
*answer = tor_strdup(get_version());
} else if (!strcmp(question, "config-file")) {
- *answer = tor_strdup(get_torrc_fname(0));
+ if (get_torrc_fname(0))
+ *answer = tor_strdup(get_torrc_fname(0));
} else if (!strcmp(question, "config-defaults-file")) {
- *answer = tor_strdup(get_torrc_fname(1));
+ if (get_torrc_fname(1))
+ *answer = tor_strdup(get_torrc_fname(1));
} else if (!strcmp(question, "config-text")) {
*answer = options_dump(get_options(), OPTIONS_DUMP_MINIMAL);
} else if (!strcmp(question, "info/names")) {