mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-25 23:21:38 +01:00
Fix additional leaks in #22103 tests
test_options_validate_impl() incorrectly executed subsequent phases of config parsing and validation after an expected error. This caused msg to leak when those later phases (which would likely produce errors as well) overwrote it.
This commit is contained in:
parent
77d9dd39c3
commit
38a13b91a8
1 changed files with 4 additions and 0 deletions
|
@ -187,6 +187,8 @@ test_options_validate_impl(const char *configuration,
|
|||
goto done;
|
||||
}
|
||||
tt_int_op((r == 0), OP_EQ, (msg == NULL));
|
||||
if (r)
|
||||
goto done;
|
||||
|
||||
r = config_assign(&options_format, opt, cl, 0, &msg);
|
||||
if (phase == PH_ASSIGN) {
|
||||
|
@ -196,6 +198,8 @@ test_options_validate_impl(const char *configuration,
|
|||
goto done;
|
||||
}
|
||||
tt_int_op((r == 0), OP_EQ, (msg == NULL));
|
||||
if (r)
|
||||
goto done;
|
||||
|
||||
r = options_validate(NULL, opt, dflt, 0, &msg);
|
||||
if (phase == PH_VALIDATE) {
|
||||
|
|
Loading…
Add table
Reference in a new issue