mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-11 05:33:47 +01:00
Fix the memory leak in warn_if_option_path_is_relative()
.
Fixes coverity defect CID 1293337, not in any released version of tor.
This commit is contained in:
parent
65cd681635
commit
79544a6fc5
@ -2558,10 +2558,12 @@ static void
|
|||||||
warn_if_option_path_is_relative(const char *option,
|
warn_if_option_path_is_relative(const char *option,
|
||||||
char *filepath)
|
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."
|
COMPLAIN("Path for %s (%s) is relative and will resolve to %s."
|
||||||
" Is this what you wanted?",option,filepath,
|
" Is this what you wanted?", option, filepath, abs_path);
|
||||||
make_path_absolute(filepath));
|
tor_free(abs_path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Scan <b>options</b> for occurances of relative file/directory
|
/** Scan <b>options</b> for occurances of relative file/directory
|
||||||
|
Loading…
Reference in New Issue
Block a user