]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix memory leak in decode_link_specifiers().
authorAlexander Færøy <ahf@torproject.org>
Sat, 23 Jun 2018 09:54:36 +0000 (11:54 +0200)
committerAlexander Færøy <ahf@torproject.org>
Sat, 23 Jun 2018 09:54:36 +0000 (11:54 +0200)
This patch fixes a memory leak in decode_link_specifiers() where the
hs_spec variable might leak if the default label is taken in the
switch/case expression.

See: Coverity CID 1437437.

src/or/hs_descriptor.c

index 938b7a77df90195c0d6db6d8232cbfc5875ebeb4..15bdd14d551d15bea1fdd550237e55c3163b9f8d 100644 (file)
@@ -864,6 +864,7 @@ decode_link_specifiers(const char *encoded)
              sizeof(hs_spec->u.legacy_id));
       break;
     default:
+      tor_free(hs_spec);
       goto err;
     }