summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaylor Yu <catalyst@torproject.org>2017-05-03 13:08:32 -0400
committerTaylor Yu <catalyst@torproject.org>2017-05-03 13:47:06 -0400
commit38a13b91a8d1f2eff623d3a6d125ccaf17164cf6 (patch)
tree0bd64228b28942b8fe59f02f5fc19a468593a6ac
parent77d9dd39c36a4da609c878840be35c515104fb9a (diff)
downloadtor-38a13b91a8d1f2eff623d3a6d125ccaf17164cf6.tar.gz
tor-38a13b91a8d1f2eff623d3a6d125ccaf17164cf6.zip
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.
-rw-r--r--src/test/test_options.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/test/test_options.c b/src/test/test_options.c
index 291147be6c..d10a93305a 100644
--- a/src/test/test_options.c
+++ b/src/test/test_options.c
@@ -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) {