diff options
Diffstat (limited to 'src/or/config.c')
-rw-r--r-- | src/or/config.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/or/config.c b/src/or/config.c index b09e3c3191..8b34dec156 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -1683,12 +1683,13 @@ option_is_recognized(const char *key) return (var != NULL); } -/** Return the canonical name of a configuration option. */ +/** Return the canonical name of a configuration option, or NULL + * if no such option exists. */ const char * option_get_canonical_name(const char *key) { config_var_t *var = config_find_option(&options_format, key); - return var->name; + return var ? var->name : NULL; } /** Return a canonicalized list of the options assigned for key. |