tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

commit dc2384da30cae716f512dedef37d27f00c43f29d
parent 8c8941eb297a166aa7b1b915a543bf97b3a63039
Author: Alexander Færøy <ahf@torproject.org>
Date:   Sat, 23 Jun 2018 10:27:10 +0200

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

Diffstat:
Msrc/test/hs_test_helpers.c | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git 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; }