[tor-commits] [tor/maint-0.3.1] Fix memory leak in decode_link_specifiers().

nickm at torproject.org nickm at torproject.org
Fri Jun 29 17:06:28 UTC 2018


commit 3d80c086bea3b0d93327c30ac620740b629cb294
Author: Alexander Færøy <ahf at torproject.org>
Date:   Sat Jun 23 11:54:36 2018 +0200

    Fix memory leak in decode_link_specifiers().
    
    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 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/or/hs_descriptor.c b/src/or/hs_descriptor.c
index 938b7a77d..15bdd14d5 100644
--- a/src/or/hs_descriptor.c
+++ b/src/or/hs_descriptor.c
@@ -864,6 +864,7 @@ decode_link_specifiers(const char *encoded)
              sizeof(hs_spec->u.legacy_id));
       break;
     default:
+      tor_free(hs_spec);
       goto err;
     }
 





More information about the tor-commits mailing list