diff options
author | Alexander Færøy <ahf@torproject.org> | 2018-06-23 10:27:10 +0200 |
---|---|---|
committer | Alexander Færøy <ahf@torproject.org> | 2018-06-23 10:27:10 +0200 |
commit | dc2384da30cae716f512dedef37d27f00c43f29d (patch) | |
tree | eb86e125712cc27e96c53960d38eac6e553f37cc | |
parent | 8c8941eb297a166aa7b1b915a543bf97b3a63039 (diff) | |
download | tor-dc2384da30cae716f512dedef37d27f00c43f29d.tar.gz tor-dc2384da30cae716f512dedef37d27f00c43f29d.zip |
Fix potential memory leak in hs_helper_build_hs_desc_impl().
This patch fixes a memory leak in hs_helper_build_hs_desc_impl() where
if a test assertion would fail we would leak the storage that `desc`
points to.
See: Coverity CID 1437448
-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 f7e054b1d1..dcd58bc5fd 100644 --- a/src/test/hs_test_helpers.c +++ b/src/test/hs_test_helpers.c @@ -142,6 +142,9 @@ hs_helper_build_hs_desc_impl(unsigned int no_ip, descp = desc; done: + if (descp == NULL) + tor_free(desc); + return descp; } |