diff options
author | Alexander Færøy <ahf@torproject.org> | 2018-06-23 00:44:33 +0200 |
---|---|---|
committer | Alexander Færøy <ahf@torproject.org> | 2018-06-23 02:29:54 +0200 |
commit | 8c8941eb297a166aa7b1b915a543bf97b3a63039 (patch) | |
tree | 4dbf7ca6dd2664fd92e25ca25415c172daafb04e | |
parent | 340fcc7e2e1c1c78bb03c997601bf57bde9bf8e6 (diff) | |
download | tor-8c8941eb297a166aa7b1b915a543bf97b3a63039.tar.gz tor-8c8941eb297a166aa7b1b915a543bf97b3a63039.zip |
Fix potential memory leak in hs_helper_build_intro_point().
This patch fixes a potential memory leak in
hs_helper_build_intro_point() where a `goto done` is called before the
`intro_point` variable have been assigned to the value of the `ip`
variable.
See: Coverity CID 1437460
See: Coverity CID 1437456
-rw-r--r-- | src/test/hs_test_helpers.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/test/hs_test_helpers.c b/src/test/hs_test_helpers.c index 3f0d6a9413..f7e054b1d1 100644 --- a/src/test/hs_test_helpers.c +++ b/src/test/hs_test_helpers.c @@ -85,6 +85,9 @@ hs_helper_build_intro_point(const ed25519_keypair_t *signing_kp, time_t now, intro_point = ip; done: + if (intro_point == NULL) + tor_free(ip); + return intro_point; } |