diff options
author | Yawning Angel <yawning@schwanenlied.me> | 2015-04-06 17:53:01 +0000 |
---|---|---|
committer | Yawning Angel <yawning@schwanenlied.me> | 2015-04-06 17:53:01 +0000 |
commit | 79544a6fc5342605a23773ba7d6fc2d863f1dd76 (patch) | |
tree | 00c93196804ccc6ced0a2347f2aad0c2a21ed0b6 | |
parent | 65cd681635f54e40dfae3091d0dc6ddf53b7fdd0 (diff) | |
download | tor-79544a6fc5342605a23773ba7d6fc2d863f1dd76.tar.gz tor-79544a6fc5342605a23773ba7d6fc2d863f1dd76.zip |
Fix the memory leak in `warn_if_option_path_is_relative()`.
Fixes coverity defect CID 1293337, not in any released version of tor.
-rw-r--r-- | src/or/config.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/or/config.c b/src/or/config.c index d65d35dfc2..00de0b99b0 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -2558,10 +2558,12 @@ static void warn_if_option_path_is_relative(const char *option, char *filepath) { - if (filepath &&path_is_relative(filepath)) + if (filepath && path_is_relative(filepath)) { + char *abs_path = make_path_absolute(filepath); COMPLAIN("Path for %s (%s) is relative and will resolve to %s." - " Is this what you wanted?",option,filepath, - make_path_absolute(filepath)); + " Is this what you wanted?", option, filepath, abs_path); + tor_free(abs_path); + } } /** Scan <b>options</b> for occurances of relative file/directory |